kopia lustrzana https://github.com/Tldraw/Tldraw
pull/3282/head
rodzic
c166f7f026
commit
07f505ceab
|
@ -17,7 +17,7 @@ export default function PopupShapeExample() {
|
|||
y: Math.floor(i / 3) * 220,
|
||||
})
|
||||
}
|
||||
editor.zoomToContent({ duration: 0 })
|
||||
editor.zoomToBounds(editor.getCurrentPageBounds()!, { animation: { duration: 0 } })
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
@ -24,10 +24,12 @@ it('zooms by increments', () => {
|
|||
})
|
||||
|
||||
it('is ignored by undo/redo', () => {
|
||||
const cameraOptions = editor.getCameraOptions()
|
||||
|
||||
editor.mark()
|
||||
editor.zoomIn()
|
||||
editor.undo()
|
||||
expect(editor.getZoomLevel()).toBe(ZOOMS[4])
|
||||
expect(editor.getZoomLevel()).toBe(cameraOptions.zoomSteps[4])
|
||||
})
|
||||
|
||||
it('preserves the screen center', () => {
|
||||
|
|
|
@ -23,10 +23,12 @@ it('zooms out and in by increments', () => {
|
|||
})
|
||||
|
||||
it('is ignored by undo/redo', () => {
|
||||
const cameraOptions = editor.getCameraOptions()
|
||||
|
||||
editor.mark()
|
||||
editor.zoomOut()
|
||||
editor.undo()
|
||||
expect(editor.getZoomLevel()).toBe(ZOOMS[2])
|
||||
expect(editor.getZoomLevel()).toBe(cameraOptions.zoomSteps[2])
|
||||
})
|
||||
|
||||
it('does not zoom out when camera is frozen', () => {
|
||||
|
|
Ładowanie…
Reference in New Issue