File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -458,14 +458,14 @@ export class Editor {
458458
459459 if ( ! this . settings . allowOverscroll ) {
460460 const imageRect = this . getImportExportRect ( ) ;
461- if ( ! this . viewport . visibleRect . intersects ( imageRect ) ) {
462- const visibleRectEdgePoint = this . viewport . visibleRect . getClosestPointOnBoundaryTo (
463- imageRect . center ,
464- ) ;
461+ const visibleRect = this . viewport . visibleRect ;
462+ if ( ! visibleRect . intersects ( imageRect ) ) {
463+ const visibleRectEdgePoint = visibleRect . getClosestPointOnBoundaryTo ( imageRect . center ) ;
465464 const imageRectEdgePoint = imageRect . getClosestPointOnBoundaryTo ( visibleRectEdgePoint ) ;
466465 const canvasDelta = visibleRectEdgePoint . minus ( imageRectEdgePoint ) ;
467466
468- if ( canvasDelta . length ( ) > 1e-10 ) {
467+ const smallValue = 1e-10 ;
468+ if ( canvasDelta . length ( ) > smallValue ) {
469469 this . viewport . resetTransform ( evt . newTransform . rightMul ( Mat33 . translation ( canvasDelta ) ) ) ;
470470 }
471471 }
You can’t perform that action at this time.
0 commit comments