From d16cfa55d7b77fb9ed50944c23aa37e4382359ef Mon Sep 17 00:00:00 2001 From: Karine Delvare Date: Sun, 30 Jul 2006 19:38:50 +0000 Subject: [PATCH] check zero division in the right place. Fixes bug #348807. 2006-07-30 Karine Delvare * app/tools/gimprectangletool.c: check zero division in the right place. Fixes bug #348807. --- ChangeLog | 5 +++++ app/tools/gimprectangletool.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8bc604b829..c4fb19daf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-30 Karine Delvare + + * app/tools/gimprectangletool.c: check zero division in the right + place. Fixes bug #348807. + 2006-07-28 DindinX * plug-ins/bmp/bmpwrite.c: small cleanups. diff --git a/app/tools/gimprectangletool.c b/app/tools/gimprectangletool.c index e070a60433..ca2688ecfc 100644 --- a/app/tools/gimprectangletool.c +++ b/app/tools/gimprectangletool.c @@ -1203,7 +1203,7 @@ gimp_rectangle_tool_motion (GimpTool *tool, switch (function) { case RECT_RESIZING_UPPER_LEFT: - if (inc_y == 0 || inc_x / inc_y < aspect) + if (inc_y != 0 && inc_x / inc_y < aspect) x1 = rx2 - (ry2 - y1) * aspect + .5; else y1 = ry2 - (rx2 - x1) / aspect + .5; @@ -1211,7 +1211,7 @@ gimp_rectangle_tool_motion (GimpTool *tool, case RECT_RESIZING_UPPER_RIGHT: case RECT_RESIZING_TOP: - if (inc_y == 0 || inc_x / inc_y < aspect) + if (inc_y != 0 && inc_x / inc_y < aspect) x2 = rx1 + (ry2 - y1) * aspect + .5; else y1 = ry2 - (x2 - rx1) / aspect + .5; @@ -1219,7 +1219,7 @@ gimp_rectangle_tool_motion (GimpTool *tool, case RECT_RESIZING_LOWER_LEFT: case RECT_RESIZING_LEFT: - if (inc_y == 0 || inc_x / inc_y < aspect) + if (inc_y != 0 && inc_x / inc_y < aspect) x1 = rx2 - (y2 - ry1) * aspect + .5; else y2 = ry1 + (rx2 - x1) / aspect + .5; @@ -1228,7 +1228,7 @@ gimp_rectangle_tool_motion (GimpTool *tool, case RECT_RESIZING_LOWER_RIGHT: case RECT_RESIZING_RIGHT: case RECT_RESIZING_BOTTOM: - if (inc_y == 0 || inc_x / inc_y < aspect) + if (inc_y != 0 && inc_x / inc_y < aspect) x2 = rx1 + (y2 - ry1) * aspect + .5; else y2 = ry1 + (x2 - rx1) / aspect + .5;