diff options
author | marc_culler <marc.culler@gmail.com> | 2020-06-03 03:23:12 (GMT) |
---|---|---|
committer | marc_culler <marc.culler@gmail.com> | 2020-06-03 03:23:12 (GMT) |
commit | 876fc6d65e63ae72fe52d8435ef703efa50fe814 (patch) | |
tree | c4fbfa804523b101ed086d4a5ea89f787ae08735 /macosx/tkMacOSXDraw.c | |
parent | aeb89ef62c14b00be0853a7539e807bb3937a6f8 (diff) | |
download | tk-876fc6d65e63ae72fe52d8435ef703efa50fe814.zip tk-876fc6d65e63ae72fe52d8435ef703efa50fe814.tar.gz tk-876fc6d65e63ae72fe52d8435ef703efa50fe814.tar.bz2 |
Do not draw in the setup proc. Fix the heartbeat so it can wake up Tcl_WaitForEvent. Handle the first drawing of a window.
Diffstat (limited to 'macosx/tkMacOSXDraw.c')
-rw-r--r-- | macosx/tkMacOSXDraw.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index 1ec2cfe..6a63449 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1658,19 +1658,19 @@ TkMacOSXSetupDrawingContext( } else if (dc.clipRgn) { /* - * Drawing can also fail when we are being called from drawRect but - * the clipping region set by drawRect does not contain the clipping - * region of our drawing context. See bug [2a61eca3a8]. + * Drawing will also fail if we are being called from drawRect but + * the clipping rectangle set by drawRect does not contain the + * clipping region of our drawing context. See bug [2a61eca3a8]. + * If we can't draw all of the clipping region of the drawing + * context then we draw whatever we can, but we also add a dirty + * rectangle so the entire widget will get redrawn in the next + * cycle. */ CGRect currentClip = CGContextGetClipBoundingBox( [NSGraphicsContext currentContext].CGContext); if (!NSContainsRect(currentClip, clipBounds)) { [view addTkDirtyRect:clipBounds]; - // XXXX we should be able to skip drawing but sometimes the clipBounds - // are wrong. - //canDraw = false; - //goto end; } } @@ -1715,10 +1715,10 @@ TkMacOSXSetupDrawingContext( CGRect r; if (!HIShapeIsRectangular(dc.clipRgn) || !CGRectContainsRect( - *HIShapeGetBounds(dc.clipRgn, &r), - CGRectApplyAffineTransform(clipBounds, t))) { - ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context); - CGContextEOClip(dc.context); + *HIShapeGetBounds(dc.clipRgn, &r), + CGRectApplyAffineTransform(clipBounds, t))) { + ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context); + CGContextEOClip(dc.context); } } if (gc) { |