summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-08-13 08:43:31 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-08-13 08:43:31 (GMT)
commit1a4d9edae0b39f0d7cf23699b1e68cbdd87f1ed4 (patch)
tree4f881c678cf790e409bd967bfee1585cf99b1a1b /macosx/tkMacOSXDraw.c
parent53bd11aa50181ad6112b9a72fda543db9ec7a4ca (diff)
downloadtk-1a4d9edae0b39f0d7cf23699b1e68cbdd87f1ed4.zip
tk-1a4d9edae0b39f0d7cf23699b1e68cbdd87f1ed4.tar.gz
tk-1a4d9edae0b39f0d7cf23699b1e68cbdd87f1ed4.tar.bz2
Fix [2874226]: polygon doesn't honor -joinstyle on Windows and OS X. This first fix deals with the OS X case only.
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 5ca8bfe..d1e67dc 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -858,6 +858,16 @@ XDrawLines(
CGContextAddLineToPoint(dc.context, prevx, prevy);
}
}
+ /*
+ * In the case of closed polylines, the first and last points
+ * are the same. We want miter or bevel join be rendered also
+ * at this point, this needs telling CoreGraphics that the
+ * path is closed.
+ */
+ if ((points[0].x == points[npoints-1].x) &&
+ (points[0].y == points[npoints-1].y)) {
+ CGContextClosePath(dc.context);
+ }
CGContextStrokePath(dc.context);
}
TkMacOSXRestoreDrawingContext(&dc);