diff --git a/app/tools/gimpdrawtool.c b/app/tools/gimpdrawtool.c index 16a26f3590..e0b4ccf652 100644 --- a/app/tools/gimpdrawtool.c +++ b/app/tools/gimpdrawtool.c @@ -37,6 +37,7 @@ #include "display/gimpcanvas.h" #include "display/gimpcanvashandle.h" #include "display/gimpcanvasline.h" +#include "display/gimpcanvaspolygon.h" #include "display/gimpcanvasrectangle.h" #include "display/gimpdisplay.h" #include "display/gimpdisplayshell.h" @@ -1360,9 +1361,20 @@ gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool, g_return_if_fail (GIMP_IS_DRAW_TOOL (draw_tool)); - if (points == NULL || n_points == 0) + if (points == NULL || n_points < 2) return; + if (draw_tool->use_cairo) + { + GimpCanvasItem *item; + + item = gimp_canvas_polygon_new (points, n_points, filled); + + draw_tool->items = g_list_append (draw_tool->items, item); + + return; + } + shell = gimp_display_get_shell (draw_tool->display); coords = g_new (GdkPoint, n_points);