Commit 13b25cfb authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

ccorrectly handle a stroke consisting of just a single point.

2005-08-06  Sven Neumann  <sven@gimp.org>

	* app/display/gimpdisplayshell-draw.c (gimp_display_shell_draw_pen):
	* app/tools/gimpforegroundselecttool.c: ccorrectly handle a stroke
	consisting of just a single point.
parent d60faca9
2005-08-06 Sven Neumann <sven@gimp.org>
* app/display/gimpdisplayshell-draw.c (gimp_display_shell_draw_pen):
* app/tools/gimpforegroundselecttool.c: ccorrectly handle a stroke
consisting of just a single point.
2005-08-06 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimppropwidgets.[ch]
......
......@@ -317,7 +317,7 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell,
canvas = GIMP_CANVAS (shell->canvas);
coords = g_new (GdkPoint, num_points);
coords = g_new (GdkPoint, MAX (2, num_points));
for (i = 0; i < num_points ; i++)
gimp_display_shell_transform_xy (shell,
......@@ -325,13 +325,21 @@ gimp_display_shell_draw_pen (GimpDisplayShell *shell,
&coords[i].x, &coords[i].y,
FALSE);
if (num_points == 1)
{
coords[1] = coords[0];
num_points = 2;
}
gc = gimp_display_shell_get_pen_gc (shell, context, color);
values.line_width = MAX (1, width);
gdk_gc_set_values (gc, &values, GDK_GC_LINE_WIDTH);
gimp_canvas_set_custom_gc (canvas, gc);
gimp_canvas_draw_lines (canvas, GIMP_CANVAS_STYLE_CUSTOM, coords, num_points);
gimp_canvas_set_custom_gc (canvas, NULL);
g_free (coords);
......
......@@ -510,6 +510,7 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
gimp_set_busy (gimage->gimp);
scan_convert = gimp_scan_convert_new ();
gimp_scan_convert_add_polyline (scan_convert,
free_sel->num_points, free_sel->points, TRUE);
......@@ -641,8 +642,24 @@ gimp_foreground_select_tool_stroke (GimpChannel *mask,
* by doing some changes to GimpScanConvert.
*/
gimp_scan_convert_add_polyline (scan_convert,
stroke->num_points, stroke->points, FALSE);
if (stroke->num_points == 1)
{
GimpVector2 points[2];
points[0] = points[1] = stroke->points[0];
points[1].x += 0.01;
points[1].y += 0.01;
gimp_scan_convert_add_polyline (scan_convert, 2, points, FALSE);
}
else
{
gimp_scan_convert_add_polyline (scan_convert,
stroke->num_points, stroke->points,
FALSE);
}
gimp_scan_convert_stroke (scan_convert,
SCALEFACTOR_Y (shell) * stroke->width,
GIMP_JOIN_MITER, GIMP_CAP_ROUND, 10.0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment