From 2153453fd1f925ef029bc62e1c8f6116736d93e2 Mon Sep 17 00:00:00 2001 From: Josep Bosch Date: Wed, 4 Dec 2013 22:32:20 +0100 Subject: [PATCH] Fixed little issue with mouse callback refering to issue 3409. Was using round instead of floor. --- modules/highgui/src/window_gtk.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/highgui/src/window_gtk.cpp b/modules/highgui/src/window_gtk.cpp index 3ee3d0c..46ac61b 100644 --- a/modules/highgui/src/window_gtk.cpp +++ b/modules/highgui/src/window_gtk.cpp @@ -1558,9 +1558,9 @@ static gboolean icvOnMouse( GtkWidget *widget, GdkEvent *event, gpointer user_da // image origin is not necessarily at (0,0) int x0 = (widget->allocation.width - image_widget->scaled_image->cols)/2; int y0 = (widget->allocation.height - image_widget->scaled_image->rows)/2; - pt.x = cvRound( ((pt32f.x-x0)*image_widget->original_image->cols)/ + pt.x = cvFloor( ((pt32f.x-x0)*image_widget->original_image->cols)/ image_widget->scaled_image->cols ); - pt.y = cvRound( ((pt32f.y-y0)*image_widget->original_image->rows)/ + pt.y = cvFloor( ((pt32f.y-y0)*image_widget->original_image->rows)/ image_widget->scaled_image->rows ); } else{ -- 2.7.4