summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDraw.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-02 15:40:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-02 15:40:48 (GMT)
commit9c29a905fa4d7ec4c5aa8528475f312dc3d39dab (patch)
tree6c94fb72da3aeb402db2137cefad6a41830b6ae8 /macosx/tkMacOSXDraw.c
parent7b5d5a25262a780c7488a3d129948e849047fdc7 (diff)
downloadtk-9c29a905fa4d7ec4c5aa8528475f312dc3d39dab.zip
tk-9c29a905fa4d7ec4c5aa8528475f312dc3d39dab.tar.gz
tk-9c29a905fa4d7ec4c5aa8528475f312dc3d39dab.tar.bz2
More implicit type-casts, for C++ compatibility.
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r--macosx/tkMacOSXDraw.c52
1 files changed, 27 insertions, 25 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c
index 22b6a45..ac5c721 100644
--- a/macosx/tkMacOSXDraw.c
+++ b/macosx/tkMacOSXDraw.c
@@ -1355,35 +1355,37 @@ TkMacOSXSetupDrawingContext(
* Finish configuring the drawing context.
*/
- CGAffineTransform t = {
- .a = 1, .b = 0,
- .c = 0, .d = -1,
- .tx = 0,
- .ty = dc.portBounds.size.height
- };
-
- dc.portBounds.origin.x += macDraw->xOff;
- dc.portBounds.origin.y += macDraw->yOff;
- CGContextSaveGState(dc.context);
- CGContextSetTextDrawingMode(dc.context, kCGTextFill);
- CGContextConcatCTM(dc.context, t);
- if (dc.clipRgn) {
+ {
+ CGAffineTransform t = {
+ .a = 1, .b = 0,
+ .c = 0, .d = -1,
+ .tx = 0,
+ .ty = dc.portBounds.size.height
+ };
-#ifdef TK_MAC_DEBUG_DRAWING
+ dc.portBounds.origin.x += macDraw->xOff;
+ dc.portBounds.origin.y += macDraw->yOff;
CGContextSaveGState(dc.context);
- ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
- CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.1);
- CGContextEOFillPath(dc.context);
- CGContextRestoreGState(dc.context);
-#endif /* TK_MAC_DEBUG_DRAWING */
+ CGContextSetTextDrawingMode(dc.context, kCGTextFill);
+ CGContextConcatCTM(dc.context, t);
+ if (dc.clipRgn) {
- CGRect r;
- CGRect b = CGRectApplyAffineTransform(
- CGContextGetClipBoundingBox(dc.context), t);
- if (!HIShapeIsRectangular(dc.clipRgn) ||
- !CGRectContainsRect(*HIShapeGetBounds(dc.clipRgn, &r), b)) {
+#ifdef TK_MAC_DEBUG_DRAWING
+ CGContextSaveGState(dc.context);
ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
- CGContextEOClip(dc.context);
+ CGContextSetRGBFillColor(dc.context, 1.0, 0.0, 0.0, 0.1);
+ CGContextEOFillPath(dc.context);
+ CGContextRestoreGState(dc.context);
+#endif /* TK_MAC_DEBUG_DRAWING */
+
+ CGRect r;
+ CGRect b = CGRectApplyAffineTransform(
+ CGContextGetClipBoundingBox(dc.context), t);
+ if (!HIShapeIsRectangular(dc.clipRgn) ||
+ !CGRectContainsRect(*HIShapeGetBounds(dc.clipRgn, &r), b)) {
+ ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context);
+ CGContextEOClip(dc.context);
+ }
}
}
if (gc) {