-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 Fix minimap dragging stopped at the end of the canvas
Fixes #306
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d4c02df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have this line at all? It seems more intuitive to not have it (more consistent with scroll bar behaviors in general)
d4c02df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChaoticMind There's a good reason, if the mouse leaves the window when pressed and then released outside of it we don't receive the
mouseup
event, and so the dragging will stay active when the mouse comeback into the window. By stopping the drag gesture when the mouse leaves the body (the window that is) we can prevent this bug from happening.d4c02df
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abe33 Aha, ok. I tested this [on xfce] and it seems to actually work at first sight. However, after releasing the cursor outside atom a couple of times, some strange things indeed start happening. This is especially obvious with multiple panes (e.g. scrolling one minimap scrolls both) and weirdly enough, selecting text also starts calling
endDrag()
.So I was thinking if this is a common problem for js apps and after a quick search, I found this post. So I tested the current behavior of minimap when:
Doing this a couple times hits the "strange behavior" I mentioned above on the current version of minimap. Easiest way to check it is to have multiple panes with files open, and trigger the alt-tab behavior mentioned above twice, then drag the second minimap - it will actually scroll both panes.
Maybe there's a clever solution that both solves the current bug with alttabbing and also allows for not triggering the
mouseupHandler
when the cursor leaves the window?