@@ -1330,7 +1330,18 @@ -(void)drawRect:(NSRect)rect
1330
1330
goto exit;
1331
1331
}
1332
1332
if (!NSIsEmptyRect (rubberband)) {
1333
- NSFrameRect (rubberband);
1333
+ // We use bezier paths so we can stroke the outside with a dash
1334
+ // pattern alternating white/black with two separate paths offset
1335
+ // in phase.
1336
+ NSBezierPath *white_path = [NSBezierPath bezierPathWithRect: rubberband];
1337
+ NSBezierPath *black_path = [NSBezierPath bezierPathWithRect: rubberband];
1338
+ double dash_pattern[2 ] = {3 , 3 };
1339
+ [white_path setLineDash: dash_pattern count: 2 phase: 0 ];
1340
+ [black_path setLineDash: dash_pattern count: 2 phase: 3 ];
1341
+ [[NSColor whiteColor ] set ];
1342
+ [white_path stroke ];
1343
+ [[NSColor blackColor ] set ];
1344
+ [black_path stroke ];
1334
1345
}
1335
1346
1336
1347
exit:
@@ -1526,16 +1537,17 @@ - (void)otherMouseDragged:(NSEvent *)event { [self mouseDragged: event]; }
1526
1537
1527
1538
- (void )setRubberband : (NSRect )rect
1528
1539
{
1529
- if (!NSIsEmptyRect (rubberband)) { [self setNeedsDisplayInRect: rubberband]; }
1530
1540
rubberband = rect;
1531
- [self setNeedsDisplayInRect: rubberband];
1541
+ // We can't just set DisplayInRect because the outer paths need to be removed
1542
+ // when shrinking the zoom-box inwards
1543
+ [self setNeedsDisplay: YES ];
1532
1544
}
1533
1545
1534
1546
- (void )removeRubberband
1535
1547
{
1536
1548
if (NSIsEmptyRect (rubberband)) { return ; }
1537
- [self setNeedsDisplayInRect: rubberband];
1538
1549
rubberband = NSZeroRect ;
1550
+ [self setNeedsDisplay: YES ];
1539
1551
}
1540
1552
1541
1553
- (const char *)convertKeyEvent : (NSEvent *)event
0 commit comments