fix(editor): Adjust default zoom level in new canvas (no-changelog) (#10469)

This commit is contained in:
Alex Grozav 2024-08-19 15:22:34 +03:00 committed by GitHub
parent 6a0f2ca96b
commit aa4404ed79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -269,7 +269,8 @@ function emitWithLastSelectedNode(emitFn: (id: string) => void) {
* View
*/
const zoom = ref(1);
const defaultZoom = 1;
const zoom = ref(defaultZoom);
function onClickPane(event: MouseEvent) {
const bounds = viewportRef.value?.getBoundingClientRect() ?? { left: 0, top: 0 };
@ -282,7 +283,7 @@ function onClickPane(event: MouseEvent) {
}
async function onFitView() {
await fitView({ maxZoom: 1.2, padding: 0.2 });
await fitView({ maxZoom: defaultZoom, padding: 0.2 });
}
async function onZoomTo(zoomLevel: number) {
@ -298,7 +299,7 @@ async function onZoomOut() {
}
async function onResetZoom() {
await onZoomTo(1);
await onZoomTo(defaultZoom);
}
function onViewportChange(viewport: ViewportTransform) {