diff options
author | fvogel <fvogelnew1@free.fr> | 2017-08-13 08:43:31 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2017-08-13 08:43:31 (GMT) |
commit | fdb30c8ae222354ea2f65a03bd2a602d92fe20ea (patch) | |
tree | 4f881c678cf790e409bd967bfee1585cf99b1a1b | |
parent | 1364a529c92c6e64af2308174eb56b09001e5fa7 (diff) | |
download | tk-fdb30c8ae222354ea2f65a03bd2a602d92fe20ea.zip tk-fdb30c8ae222354ea2f65a03bd2a602d92fe20ea.tar.gz tk-fdb30c8ae222354ea2f65a03bd2a602d92fe20ea.tar.bz2 |
Fix [2874226]: polygon doesn't honor -joinstyle on Windows and OS X. This first fix deals with the OS X case only.
-rw-r--r-- | macosx/tkMacOSXDraw.c | 10 |
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); |