Skip to content

Commit

Permalink
Take page offset into account too (#54567)
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Jan 14, 2020
1 parent 3f46e2b commit b93d810
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -303,7 +303,9 @@ export class LegacyCoreEditor implements CoreEditor {
const maxLineLength = this.getWrapLimit() - 5;
const isWrapping = firstLine.length > maxLineLength;
const getScreenCoords = (line: number) =>
this.editor.renderer.textToScreenCoordinates(line - 1, startColumn).pageY - offsetFromPage;
this.editor.renderer.textToScreenCoordinates(line - 1, startColumn).pageY -
offsetFromPage +
(window.pageYOffset || 0);
const topOfReq = getScreenCoords(startLine);

if (topOfReq >= 0) {
Expand Down

0 comments on commit b93d810

Please sign in to comment.