From 2a31cf8d81632f00cfe04b96e1c771bd116b401b Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Sun, 26 Jul 2026 20:13:21 +0200 Subject: [PATCH] Viewer: stop forcing FullViewportUpdate in JFJochSimpleImage FullViewportUpdate redraws the whole viewport on any change. The attached comment ("keep overlays in pixel units independent of zoom") does not describe what the setting does, and nothing here needs it: SmartViewportUpdate repaints the changed rectangles and falls back to a full repaint by itself once there are too many to be worth tracking. This is the view used by the calibration window and the magnifier, and the magnifier is driven from every hover, so on a remote session it repainted its whole viewport per pointer motion. Note: not exercised visually -- both windows are opened from menus, which the headless harness does not drive. The change is a repaint-mode switch with no effect on what is drawn. Co-Authored-By: Claude Opus 5 (1M context) --- viewer/image_viewer/JFJochSimpleImage.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/viewer/image_viewer/JFJochSimpleImage.cpp b/viewer/image_viewer/JFJochSimpleImage.cpp index 75b43270..5e561cfa 100644 --- a/viewer/image_viewer/JFJochSimpleImage.cpp +++ b/viewer/image_viewer/JFJochSimpleImage.cpp @@ -16,8 +16,9 @@ JFJochSimpleImage::JFJochSimpleImage(QWidget *parent) auto *scn = new QGraphicsScene(this); setScene(scn); - // Keep overlays in pixel units independent of zoom (for labels font sizing) - setViewportUpdateMode(QGraphicsView::FullViewportUpdate); + // Repaint only what changed. FullViewportUpdate redraws the entire viewport on any change, + // which is wasted work locally and, on a remote session, uploads far more than was touched. + setViewportUpdateMode(QGraphicsView::SmartViewportUpdate); // The predicted/float image is unreadable with 3-decimal per-pixel labels. label_decimals_ = 1;