File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -2603,15 +2603,28 @@ export class WorkspaceSvg
26032603 let deltaY = 0 ;
26042604
26052605 if ( bounds . left < viewport . left ) {
2606- deltaX = viewport . left - bounds . left ;
2606+ deltaX = this . RTL
2607+ ? Math . min (
2608+ viewport . left - bounds . left ,
2609+ viewport . right - bounds . right , // Don't move the right side out of view
2610+ )
2611+ : viewport . left - bounds . left ;
26072612 } else if ( bounds . right > viewport . right ) {
2608- deltaX = viewport . right - bounds . right ;
2613+ deltaX = this . RTL
2614+ ? viewport . right - bounds . right
2615+ : Math . max (
2616+ viewport . right - bounds . right ,
2617+ viewport . left - bounds . left , // Don't move the left side out of view
2618+ ) ;
26092619 }
26102620
26112621 if ( bounds . top < viewport . top ) {
26122622 deltaY = viewport . top - bounds . top ;
26132623 } else if ( bounds . bottom > viewport . bottom ) {
2614- deltaY = viewport . bottom - bounds . bottom ;
2624+ deltaY = Math . max (
2625+ viewport . bottom - bounds . bottom ,
2626+ viewport . top - bounds . top , // Don't move the top out of view
2627+ ) ;
26152628 }
26162629
26172630 deltaX *= scale ;
You can’t perform that action at this time.
0 commit comments