From fdb30c8ae222354ea2f65a03bd2a602d92fe20ea Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Aug 2017 08:43:31 +0000 Subject: Fix [2874226]: polygon doesn't honor -joinstyle on Windows and OS X. This first fix deals with the OS X case only. --- macosx/tkMacOSXDraw.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- cgit v0.12