You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the console, execute Blockly.getMainWorkspace().setScale(1) multiple times
Observe scroll of workspace.
Expected behavior
Expect workspace to not scroll on repeated setScale calls.
Additional context
The cause of this scroll appears to be the addition of absoluteTop and absoluteLeft to scrollX/scrollY inside of setScale
This math is needed for zoom logic, but not for every function that calls setScroll (zoomToFit and zoomReset_ don't need this translation and have a scrollToCenter call after calling setScale to compensate).
It causes odd behaviour with single-direction scrollbars when zoomReset is called.
The text was updated successfully, but these errors were encountered:
Describe the bug
Calling
setScale
causes an unexpected scroll of the workspace.To Reproduce
Steps to reproduce the behavior:
Blockly.getMainWorkspace().setScale(1)
multiple timesExpected behavior
Expect workspace to not scroll on repeated
setScale
calls.Additional context
The cause of this scroll appears to be the addition of
absoluteTop
andabsoluteLeft
toscrollX
/scrollY
inside ofsetScale
This math is needed for
zoom
logic, but not for every function that callssetScroll
(zoomToFit
andzoomReset_
don't need this translation and have ascrollToCenter
call after callingsetScale
to compensate).It causes odd behaviour with single-direction scrollbars when
zoomReset
is called.The text was updated successfully, but these errors were encountered: