Fix erratic axis scaling when hovering over plots
InfiniteLine was included in auto-range calculations, causing the view to rescale on every cursor move. Add it with ignoreBounds=True in both the initial setup and after each redraw. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -363,7 +363,7 @@ class PlotTab(QWidget):
|
|||||||
pen=pg.mkPen("gray", width=1, style=Qt.DashLine),
|
pen=pg.mkPen("gray", width=1, style=Qt.DashLine),
|
||||||
)
|
)
|
||||||
vl.setVisible(False)
|
vl.setVisible(False)
|
||||||
pw.addItem(vl)
|
pw.addItem(vl, ignoreBounds=True)
|
||||||
self._vlines.append(vl)
|
self._vlines.append(vl)
|
||||||
|
|
||||||
proxy = pg.SignalProxy(
|
proxy = pg.SignalProxy(
|
||||||
@@ -504,7 +504,7 @@ class PlotTab(QWidget):
|
|||||||
for i, pw in enumerate(self._plot_widgets):
|
for i, pw in enumerate(self._plot_widgets):
|
||||||
pi = pw.getPlotItem()
|
pi = pw.getPlotItem()
|
||||||
pi.clear()
|
pi.clear()
|
||||||
pi.addItem(self._vlines[i])
|
pi.addItem(self._vlines[i], ignoreBounds=True)
|
||||||
if pi.legend:
|
if pi.legend:
|
||||||
pi.legend.clear()
|
pi.legend.clear()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user