From 6bb3860e77c706c2661dacfd0f70b0f1abd621f8 Mon Sep 17 00:00:00 2001 From: fvogel Date: Thu, 29 Jul 2021 06:09:30 +0000 Subject: Experiment. Change macOS damage region computation: use xor(source,destination). --- macosx/tkMacOSXDraw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index bbb9b23..402d154 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1143,7 +1143,7 @@ TkScrollWindow( MacDrawable *macDraw = (MacDrawable *)drawable; TKContentView *view = (TKContentView *)TkMacOSXGetNSViewForDrawable(macDraw); CGRect srcRect, dstRect; - HIShapeRef dmgRgn = NULL, extraRgn = NULL; + HIShapeRef dmgRgn = NULL, extraRgn = NULL, unionRgn = NULL, intersectRgn = NULL; NSRect bounds, visRect, scrollSrc, scrollDst; int result = 0; @@ -1182,7 +1182,11 @@ TkScrollWindow( dmgRgn = HIShapeCreateMutableWithRect(&srcRect); extraRgn = HIShapeCreateWithRect(&dstRect); ChkErr(HIShapeUnion, dmgRgn, extraRgn, - (HIMutableShapeRef) dmgRgn); + (HIMutableShapeRef) unionRgn); + ChkErr(HIShapeIntersect, dmgRgn, extraRgn, + (HIMutableShapeRef) intersectRgn); + ChkErr(HIShapeDifference, unionRgn, intersectRgn, + (HIMutableShapeRef) dmgRgn); result = HIShapeIsEmpty(dmgRgn) ? 0 : 1; /* -- cgit v0.12