File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -17,20 +17,15 @@ import * as Blockly from 'blockly/core';
1717 * @param workspace The workspace to scroll the given bounds into view in.
1818 */
1919export function scrollBoundsIntoView (
20- originalBounds : Blockly . utils . Rect ,
20+ bounds : Blockly . utils . Rect ,
2121 workspace : Blockly . WorkspaceSvg ,
2222) {
23+ if ( Blockly . Gesture . inProgress ( ) ) {
24+ // This can cause jumps during a drag and it only suited for keyboard nav.
25+ return ;
26+ }
2327 const scale = workspace . getScale ( ) ;
2428
25- const bounds = originalBounds . clone ( ) ;
26-
27- // Add some padding to the bounds so the element is scrolled comfortably
28- // into view.
29- bounds . top -= 10 ;
30- bounds . bottom += 10 ;
31- bounds . left -= 10 ;
32- bounds . right += 10 ;
33-
3429 const rawViewport = workspace . getMetricsManager ( ) . getViewMetrics ( true ) ;
3530 const viewport = new Blockly . utils . Rect (
3631 rawViewport . top ,
@@ -49,6 +44,14 @@ export function scrollBoundsIntoView(
4944 return ;
5045 }
5146
47+ // Add some padding to the bounds so the element is scrolled comfortably
48+ // into view.
49+ bounds = bounds . clone ( ) ;
50+ bounds . top -= 10 ;
51+ bounds . bottom += 10 ;
52+ bounds . left -= 10 ;
53+ bounds . right += 10 ;
54+
5255 let deltaX = 0 ;
5356 let deltaY = 0 ;
5457
You can’t perform that action at this time.
0 commit comments