Skip to content

Commit

Permalink
ui/image: Fix handling of secondary mouse clicks. #19 (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
roblillack authored Jun 29, 2024
1 parent cf7f85f commit b9b3b2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/image_fltk.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (c *Image) handleEvent(e goFltk.Event) bool {
// }

if e == goFltk.PUSH {
c.OnClick(goFltk.EventX()-c.X, goFltk.EventY()-c.Y, goFltk.EventButton1())
c.OnClick(goFltk.EventX()-c.X, goFltk.EventY()-c.Y, !goFltk.EventButton1())
}

return false
Expand Down
7 changes: 5 additions & 2 deletions ui/internal/cocoa/interactiveview.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
@implementation InteractiveView
- (void)mouseDown:(NSEvent *)theEvent {
NSPoint p = [self convertPoint:theEvent.locationInWindow fromView:nil];
onInteractiveViewClicked((InteractiveViewPtr)self, p.x, p.y,
theEvent.buttonNumber != 1);
onInteractiveViewClicked((InteractiveViewPtr)self, p.x, p.y, false);
}
- (void)rightMouseDown:(NSEvent *)theEvent {
NSPoint p = [self convertPoint:theEvent.locationInWindow fromView:nil];
onInteractiveViewClicked((InteractiveViewPtr)self, p.x, p.y, true);
}
@end

Expand Down

0 comments on commit b9b3b2e

Please sign in to comment.