Why is the return value of the ace editor's getScrollTop function different from the value of the scrollTop property?

17 Views Asked by At

enter image description here

I just test in browser console and find that the two values are different, and I use editor.renderer.scrollToY to change the scrollTop vlaue.

const targetY = editor.renderer.lineHeight * (editor.getCursorPositionScreen().row - 2);
editor.renderer.scrollToY(targetY);
editor.clearSelection();

Does anyone encounter the same problem.

0

There are 0 best solutions below