File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
packages/base/src/mainview Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -2113,9 +2113,14 @@ export class MainView extends React.Component<IProps, IStates> {
21132113 const currentZoom = view . getZoom ( ) || 0 ;
21142114 const targetCenter : Coordinate = [ center . x , center . y ] ;
21152115
2116- if ( transitionType === 'immediate' ) {
2117- view . setCenter ( targetCenter ) ;
2118- view . setZoom ( zoom ) ;
2116+ if ( transitionType === 'linear' ) {
2117+ // Linear: direct zoom
2118+ view . animate ( {
2119+ center : targetCenter ,
2120+ zoom : zoom ,
2121+ duration,
2122+ } ) ;
2123+
21192124 return ;
21202125 }
21212126
@@ -2140,14 +2145,13 @@ export class MainView extends React.Component<IProps, IStates> {
21402145 duration : duration * 0.5 ,
21412146 } ,
21422147 ) ;
2143- } else {
2144- // Linear: direct zoom
2145- view . animate ( {
2146- center : targetCenter ,
2147- zoom : zoom ,
2148- duration,
2149- } ) ;
2148+
2149+ return ;
21502150 }
2151+
2152+ // Immediate move
2153+ view . setCenter ( targetCenter ) ;
2154+ view . setZoom ( zoom ) ;
21512155 }
21522156
21532157 private _onPointerMove ( e : MouseEvent ) {
You can’t perform that action at this time.
0 commit comments