fixed off-by-one (too large) drawing of boundaries by copying the resp.

2007-05-05  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_boundary): fixed
	off-by-one (too large) drawing of boundaries by copying the resp.
	code and its obscure comment from gimpdisplayshell-selection.c
	Fixes bug #416432.


svn path=/trunk/; revision=22417
This commit is contained in:
Michael Natterer 2007-05-05 04:33:38 +00:00 committed by Michael Natterer
parent 228c2ff0c5
commit f9d9ecfd7a
2 changed files with 45 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-05-05 Michael Natterer <mitch@gimp.org>
* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_boundary): fixed
off-by-one (too large) drawing of boundaries by copying the resp.
code and its obscure comment from gimpdisplayshell-selection.c
Fixes bug #416432.
2007-05-04 Sven Neumann <sven@gimp.org>
* app/dialogs/tips-dialog.c: make the tips label selectable.

View File

@ -1464,6 +1464,24 @@ gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool,
gdk_points[0].x = CLAMP (x, -1, xmax);
gdk_points[0].y = CLAMP (y, -1, ymax);
/* If this segment is a closing segment && the segments lie inside
* the region, OR if this is an opening segment and the segments
* lie outside the region...
* we need to transform it by one display pixel
*/
if (! bound_segs[i].open)
{
/* If it is vertical */
if (bound_segs[i].x1 == bound_segs[i].x2)
{
gdk_points[0].x -= 1;
}
else
{
gdk_points[0].y -= 1;
}
}
n_gdk_points++;
}
@ -1478,6 +1496,26 @@ gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool,
gdk_points[n_gdk_points].x = CLAMP (x, -1, xmax);
gdk_points[n_gdk_points].y = CLAMP (y, -1, ymax);
/* If this segment is a closing segment && the segments lie inside
* the region, OR if this is an opening segment and the segments
* lie outside the region...
* we need to transform it by one display pixel
*/
if (! bound_segs[i].open)
{
/* If it is vertical */
if (bound_segs[i].x1 == bound_segs[i].x2)
{
gdk_points[n_gdk_points ].x -= 1;
gdk_points[n_gdk_points - 1].x -= 1;
}
else
{
gdk_points[n_gdk_points ].y -= 1;
gdk_points[n_gdk_points - 1].y -= 1;
}
}
n_gdk_points++;
}