From 07ecc12c2a0984db9d4fc180c763dffd2aced7ac Mon Sep 17 00:00:00 2001 From: Dave Neary Date: Mon, 5 Aug 2002 09:30:33 +0000 Subject: [PATCH] Require a minimum movement in the X and Y direction before we zoom in 2002-08-05 Dave Neary * app/tools/gimpmagnifytool.[ch]: Require a minimum movement in the X and Y direction before we zoom in on/out to the dragged square. Limit rather arbitrarily set to 5. This fixes bug #86939, reported by philipj@telia.com. --- ChangeLog | 8 ++++++++ app/tools/gimpmagnifytool.c | 12 ++++++++++-- app/tools/gimpmagnifytool.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 552047d2e4..8dd9f5a519 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-08-05 Dave Neary + + * app/tools/gimpmagnifytool.[ch]: Require a minimum + movement in the X and Y direction before we zoom in + on/out to the dragged square. Limit rather arbitrarily + set to 5. This fixes bug #86939, reported by + philipj@telia.com. + 2002-08-04 Sven Neumann * plug-ins/common/gauss_iir.c diff --git a/app/tools/gimpmagnifytool.c b/app/tools/gimpmagnifytool.c index b722194748..31ce788060 100644 --- a/app/tools/gimpmagnifytool.c +++ b/app/tools/gimpmagnifytool.c @@ -311,6 +311,7 @@ gimp_magnify_tool_motion (GimpTool *tool, GimpDisplay *gdisp) { GimpMagnifyTool *magnify; + gint w, h; if (!gimp_tool_control_is_active (tool->control)) return; @@ -319,9 +320,16 @@ gimp_magnify_tool_motion (GimpTool *tool, gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); - magnify->w = (coords->x - magnify->x); - magnify->h = (coords->y - magnify->y); + w = (coords->x - magnify->x); + h = (coords->y - magnify->y); + if((THRESHOLD <= (w > 0 ? w : -w)) && + (THRESHOLD <= (h > 0 ? h : -h))) + { + magnify->w = w; + magnify->h = h; + } + gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool)); } diff --git a/app/tools/gimpmagnifytool.h b/app/tools/gimpmagnifytool.h index 5cd3a2ef25..befe6a9b83 100644 --- a/app/tools/gimpmagnifytool.h +++ b/app/tools/gimpmagnifytool.h @@ -30,6 +30,7 @@ #define GIMP_IS_MAGNIFY_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MAGNIFY_TOOL)) #define GIMP_MAGNIFY_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MAGNIFY_TOOL, GimpMagnifyToolClass)) +#define THRESHOLD 5 typedef struct _GimpMagnifyTool GimpMagnifyTool; typedef struct _GimpMagnifyToolClass GimpMagnifyToolClass;