Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f285953

Browse files
committed
Round to match UI
1 parent 73a51d1 commit f285953

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ImageWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,13 +1106,13 @@ void ImageWindow::drawCursorInfoBox()
11061106
// If the zoom level is high enough, we will draw a marker that is locked to half-pixel units, and the info box will be
11071107
// locked to that. Otherwise, we just follow the mouse cursor with the info box.
11081108
QPointF infoBoxRef; // reference coordinates for the inf box.
1109-
double const markerZoomLevel = 64;
1109+
double const markerZoomLevel = 32;
11101110
QRect pixelMarkerRect;
11111111

11121112
//Pixel coordinates
11131113
QPointF zoomedPos = mapToScene(curMousePos.toPoint());
11141114

1115-
if (zoomFactor >= markerZoomLevel) {
1115+
if (floor(zoomFactor * 100 + .5) >= markerZoomLevel * 100) {
11161116
// Round them to the nearest 0.5 pixels.
11171117
zoomedPos.setX(floor(zoomedPos.x() * 2 + 0.5) / 2.0);
11181118
zoomedPos.setY(floor(zoomedPos.y() * 2 + 0.5) / 2.0);

0 commit comments

Comments
 (0)