much better ux

This commit is contained in:
John McLear 2020-12-28 09:34:58 +00:00
parent a536b311e4
commit 92450e071d
2 changed files with 5 additions and 7 deletions

View file

@ -280,13 +280,12 @@ Scroll.prototype.scrollNodeVerticallyIntoView = function (rep, innerHeight, isPa
// to inside of the viewport. Tested on IE, Firefox, Chrome in releases from 2015 until now
// So, when the line scrolled gets outside of the viewport we let the browser handle it.
const linePosition = caretPosition.getPosition();
if (isPageUp) {
// redraw entire page into view putting rep.selStart[0] at top left
const distanceOfTopOfViewport = linePosition.top - viewport.top;
const pixelsToScroll =
distanceOfTopOfViewport - this._getPixelsRelativeToPercentageOfViewport(innerHeight, true);
this._scrollYPage(pixelsToScroll);
this._scrollYPage(pixelsToScroll - linePosition.height);
return;
}