diff --git a/zxlive/graphview.py b/zxlive/graphview.py index b4415956..ad132d05 100644 --- a/zxlive/graphview.py +++ b/zxlive/graphview.py @@ -80,6 +80,8 @@ def __init__(self, graph_scene: GraphScene) -> None: # self.setResizeAnchor(QGraphicsView.ViewportAnchor.AnchorViewCenter) self.setResizeAnchor(QGraphicsView.ViewportAnchor.AnchorUnderMouse) #self.setDragMode(QGraphicsView.DragMode.ScrollHandDrag) # This has to be enabled based on keyboard shortcuts + self.setCacheMode(QGraphicsView.CacheModeFlag.CacheBackground); + self.setViewportUpdateMode(QGraphicsView.ViewportUpdateMode.BoundingRectViewportUpdate); # We implement the rubberband logic ourselves. Note that there is also # the option to set `self.setDragMode(QGraphicsView.RubberBandDrag)`, diff --git a/zxlive/vitem.py b/zxlive/vitem.py index f7afc6d7..ca4d2fab 100644 --- a/zxlive/vitem.py +++ b/zxlive/vitem.py @@ -168,6 +168,7 @@ def refresh(self) -> None: brush.setStyle(Qt.BrushStyle.Dense1Pattern) self.setBrush(brush) pen.setColor(colors.boundary_pressed) + self.prepareGeometryChange() self.setPen(pen) if self.phase_item: