Fix viewport on initial load
This commit is contained in:
parent
cb1f4e242e
commit
8cba193bfd
2 changed files with 5 additions and 3 deletions
|
@ -1368,6 +1368,8 @@ export class TldrawApp extends StateManager<TDSnapshot> {
|
|||
},
|
||||
'loaded_document'
|
||||
)
|
||||
const { point, zoom } = this.pageState.camera
|
||||
this.updateViewport(point, zoom)
|
||||
return this
|
||||
}
|
||||
|
||||
|
|
|
@ -251,9 +251,9 @@ export class TranslateSession extends BaseSession {
|
|||
? Utils.snapBoundsToGrid(Utils.translateBounds(initialCommonBounds, delta), currentGrid)
|
||||
: Utils.translateBounds(initialCommonBounds, delta)
|
||||
),
|
||||
(this.isCloning ? this.snapInfo.bounds : this.snapInfo.others).filter(
|
||||
(bounds) => Utils.boundsContain(viewport, bounds) || Utils.boundsCollide(viewport, bounds)
|
||||
),
|
||||
(this.isCloning ? this.snapInfo.bounds : this.snapInfo.others).filter((bounds) => {
|
||||
return Utils.boundsContain(viewport, bounds) || Utils.boundsCollide(viewport, bounds)
|
||||
}),
|
||||
SNAP_DISTANCE / camera.zoom
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue