Skip to content

Commit c7faa7f

Browse files
Add _emulatedLeftMouseDownButton for #31899
Co-authored-by: Mishanil Kazreen <[email protected]>
1 parent dfc34f7 commit c7faa7f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/macos/MPLFigureCanvas.m‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ @interface MPLFigureCanvas () <CALayerDelegate>
3232
@implementation MPLFigureCanvas {
3333
BOOL _isLeftMouseDown;
3434
BOOL _isHandCursorActive;
35+
NSInteger _emulatedLeftMouseDownButton;
3536
NSEventModifierFlags _previousModifierFlags;
3637
MPLRubberbandView *_rubberbandView;
3738
BOOL _needsDrawOnNextDisplayLayer;
@@ -324,11 +325,15 @@ - (void) _handleMouseDownOrUp:(NSEvent *)event isPress:(BOOL)isPress
324325
}
325326

326327
_isLeftMouseDown = YES;
328+
_emulatedLeftMouseDownButton = buttonNumber;
327329

328330
[self _updateHandCursor];
329331

330332
} else if ([event type] == NSEventTypeLeftMouseUp) {
331-
_isLeftMouseDown = NO;
333+
if (_isLeftMouseDown) {
334+
buttonNumber = _emulatedLeftMouseDownButton;
335+
_isLeftMouseDown = NO;
336+
}
332337

333338
[self _updateHandCursor];
334339
}

0 commit comments

Comments
 (0)