From 8c4d79aea26f1b48214b2127210da5ec0638345d Mon Sep 17 00:00:00 2001 From: starlit Date: Fri, 24 Jul 2026 14:12:21 +0300 Subject: [PATCH 1/2] Fix magnifying glass zoom jump at image edges on HiDPI displays In single-page mode Viewer::grabMagnifiedRegion built the magnified image with a device pixel ratio of devicePixelRatioF() in the out-of-bounds branch, while the in-bounds branch returns a DPR-1 image and the source crop is itself DPR 1. A QPainter draws in logical coordinates, so painting the DPR-1 crop onto a DPR-2 (Retina) image scaled the content up by the ratio and clipped it. Because this only happens once the sampled region touches the page edge, magnification jumped discontinuously near the left/right edges and edge detail was pushed off the loupe. Keep the out-of-bounds image at DPR 1 so both branches produce the same scale. --- YACReader/viewer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/YACReader/viewer.cpp b/YACReader/viewer.cpp index df7cbacc9..17d6d1903 100644 --- a/YACReader/viewer.cpp +++ b/YACReader/viewer.cpp @@ -1070,8 +1070,12 @@ QImage Viewer::grabMagnifiedRegion(const QPoint &viewerPos, const QSize &glassSi } if (outImage) { + // The magnified image is kept at source resolution (device pixel ratio 1), + // matching the in-bounds path below. Do NOT set a >1 device pixel ratio here: + // a QPainter draws in logical coordinates, so painting the DPR-1 source crop + // onto a DPR>1 image would scale the content up by the ratio (and clip it), + // producing a sudden magnification jump at the image edges on HiDPI displays. QImage img(zoomWScaled, zoomHScaled, QImage::Format_RGB32); - img.setDevicePixelRatio(devicePixelRatioF()); img.fill(bgColor); if (zw > 0 && zh > 0) { QPainter painter(&img); From 1241e8227470565067b1713a703db17c9523c6f5 Mon Sep 17 00:00:00 2001 From: starlit Date: Fri, 24 Jul 2026 14:12:39 +0300 Subject: [PATCH 2/2] Don't trigger the page-selection bar while the magnifying glass is active With the magnifying glass active, moving the cursor to the bottom of the page hit the goToFlow page-selection hover zone. The bar did not visibly appear, but the hover handling took over the mouse events there, so the magnifying glass stopped following the cursor and could not reach the bottom of the page. Skip the bottom hover zone while the magnifying glass is shown. --- YACReader/mouse_handler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/YACReader/mouse_handler.cpp b/YACReader/mouse_handler.cpp index dcdfec9f4..9cb3aac82 100644 --- a/YACReader/mouse_handler.cpp +++ b/YACReader/mouse_handler.cpp @@ -109,7 +109,9 @@ void YACReader::MouseHandler::mouseMoveEvent(QMouseEvent *event) if (gtfPos.y() < 0 || gtfPos.x() < 0 || gtfPos.x() > viewer->goToFlow->width()) // TODO this extra check is for Mavericks (mouseMove over goToFlowGL seems to be broken) viewer->animateHideGoToFlow(); // goToFlow->hide(); - } else { + } else if (!viewer->magnifyingGlassShown) { + // Don't pop up the bottom page-selection bar while the + // magnifying glass is active: it prevents magnifying that area. int umbral = (viewer->width() - viewer->goToFlow->width()) / 2; if ((position.y() > viewer->height() - 15) && (position.x() > umbral) && (position.x() < viewer->width() - umbral)) {