Skip to content

Commit

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

if (topOfReq >= 0) {
Expand Down

0 comments on commit 718a975

Please sign in to comment.