Skip to content

Commit eb2cfdf

Browse files
committed
fix ajaxorg#1629 Not able to scroll smoothly with a Mac trackpad, when the pointer is inside the editor.
1 parent bfd68fb commit eb2cfdf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/ace/virtual_renderer.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,8 +1335,10 @@ var VirtualRenderer = function(container, theme) {
13351335
- this.layerConfig.maxHeight - (this.$size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd
13361336
< -1 + this.scrollMargin.bottom)
13371337
return true;
1338-
// todo: better handle horizontal scrolling
1339-
if (deltaX)
1338+
if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left)
1339+
return true;
1340+
if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth
1341+
- this.layerConfig.width < -1 + this.scrollMargin.right)
13401342
return true;
13411343
};
13421344

0 commit comments

Comments
 (0)