diff options
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/win32/gdkdrawable-win32.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c index 819adf6fcc..7a86fe7a02 100644 --- a/gdk/win32/gdkdrawable-win32.c +++ b/gdk/win32/gdkdrawable-win32.c @@ -955,12 +955,16 @@ gdk_win32_draw_polygon (GdkDrawable *drawable, { bounds.x = MIN (bounds.x, points[i].x); bounds.y = MIN (bounds.y, points[i].y); - bounds.width = MAX (bounds.width, points[i].x - bounds.x); - bounds.height = MAX (bounds.height, points[i].y - bounds.y); pts[i].x = points[i].x; pts[i].y = points[i].y; } + for (i = 0; i < npoints; i++) + { + bounds.width = MAX (bounds.width, points[i].x - bounds.x); + bounds.height = MAX (bounds.height, points[i].y - bounds.y); + } + if (points[0].x != points[npoints-1].x || points[0].y != points[npoints-1].y) { @@ -1250,6 +1254,10 @@ gdk_win32_draw_segments (GdkDrawable *drawable, bounds.x = MIN (bounds.x, segs[i].x2); bounds.y = MIN (bounds.y, segs[i].y1); bounds.y = MIN (bounds.y, segs[i].y2); + } + + for (i = 0; i < nsegs; i++) + { bounds.width = MAX (bounds.width, segs[i].x1 - bounds.x); bounds.width = MAX (bounds.width, segs[i].x2 - bounds.x); bounds.height = MAX (bounds.height, segs[i].y1 - bounds.y); @@ -1353,12 +1361,16 @@ gdk_win32_draw_lines (GdkDrawable *drawable, { bounds.x = MIN (bounds.x, points[i].x); bounds.y = MIN (bounds.y, points[i].y); - bounds.width = MAX (bounds.width, points[i].x - bounds.x); - bounds.height = MAX (bounds.height, points[i].y - bounds.y); pts[i].x = points[i].x; pts[i].y = points[i].y; } + for (i = 0; i < npoints; i++) + { + bounds.width = MAX (bounds.width, points[i].x - bounds.x); + bounds.height = MAX (bounds.height, points[i].y - bounds.y); + } + region = widen_bounds (&bounds, GDK_GC_WIN32 (gc)->pen_width); generic_draw (drawable, gc, GDK_GC_FOREGROUND|LINE_ATTRIBUTES, |