diff --git a/viewer/image_viewer/JFJochImage.cpp b/viewer/image_viewer/JFJochImage.cpp index c266660b..46711144 100644 --- a/viewer/image_viewer/JFJochImage.cpp +++ b/viewer/image_viewer/JFJochImage.cpp @@ -43,6 +43,15 @@ JFJochImage::JFJochImage(QWidget *parent) : QGraphicsView(parent) { } void JFJochImage::onScroll(int value) { + // While the user drags a pan, the scene scrolls natively and overlay items + // (which live in scene coordinates) move with it - no rebuild is needed. A + // single pan step emits up to two scrollbar valueChanged signals; rebuilding + // the overlay on each would tear down and recreate every item for no visual + // change - the dominant lag over remote X. The overlay is refreshed once + // when the pan ends (mouseReleaseEvent -> updateROI -> updateOverlay), which + // re-runs spot/prediction culling for the newly revealed viewport. + if (mouse_event_type == MouseEventType::Panning) + return; scheduleOverlayUpdate(); } @@ -221,7 +230,9 @@ void JFJochImage::mouseMoveEvent(QMouseEvent *event) { horizontalScrollBar()->setValue(horizontalScrollBar()->value() - viewDelta.x()); verticalScrollBar()->setValue(verticalScrollBar()->value() - viewDelta.y()); - scheduleOverlayUpdate(); + // No overlay rebuild while dragging: the scene scrolls natively and + // items move with it. onScroll() skips rebuilds during a pan and the + // overlay is refreshed once on mouse release. emitViewportChanged(); break; }