mirror of
https://github.com/atom/atom.git
synced 2026-02-08 05:35:04 -05:00
Always honor scroll intent on mousewheel
This commit introduces a change in the way we respond to mousewheel events. In particular, if `delta * scrollSensitivity` is less than 1 or greater than -1, we will round it up or down in an attempt to honor the user's scroll intent.
This commit is contained in:
@@ -1511,11 +1511,15 @@ class TextEditorComponent {
|
||||
let {deltaX, deltaY} = event
|
||||
|
||||
if (Math.abs(deltaX) > Math.abs(deltaY)) {
|
||||
deltaX = deltaX * scrollSensitivity
|
||||
deltaX = (Math.sign(deltaX) === 1)
|
||||
? Math.max(1, deltaX * scrollSensitivity)
|
||||
: Math.min(-1, deltaX * scrollSensitivity)
|
||||
deltaY = 0
|
||||
} else {
|
||||
deltaX = 0
|
||||
deltaY = deltaY * scrollSensitivity
|
||||
deltaY = (Math.sign(deltaY) === 1)
|
||||
? Math.max(1, deltaY * scrollSensitivity)
|
||||
: Math.min(-1, deltaY * scrollSensitivity)
|
||||
}
|
||||
|
||||
if (this.getPlatform() !== 'darwin' && event.shiftKey) {
|
||||
|
||||
Reference in New Issue
Block a user