From 411b7b59751032fc17e8b353d682a434dcf0d3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=B6ssie?= Date: Mon, 14 Aug 2017 21:52:01 +0200 Subject: [PATCH] Fix wrong rounding in `PreviewWindow` (fixes #3773) --- rtgui/previewwindow.cc | 2 +- rtgui/previewwindow.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/previewwindow.cc b/rtgui/previewwindow.cc index 015c30d4c..cd4e0c75c 100644 --- a/rtgui/previewwindow.cc +++ b/rtgui/previewwindow.cc @@ -216,7 +216,7 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event) CursorShape newType = cursor_type; if (isMoving) { - mainCropWin->remoteMove ((int)((event->x - (double)press_x) / zoom), (int)((event->y - (double)press_y) / zoom)); + mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom); press_x = event->x; press_y = event->y; } else if (inside) { diff --git a/rtgui/previewwindow.h b/rtgui/previewwindow.h index a7b286202..f50411170 100644 --- a/rtgui/previewwindow.h +++ b/rtgui/previewwindow.h @@ -36,7 +36,7 @@ private: ImageArea* imageArea; int imgX, imgY, imgW, imgH; double zoom; - int press_x, press_y; + double press_x, press_y; bool isMoving; bool needsUpdate; CursorShape cursor_type;