Skip to content

Commit

Permalink
fix(editor): Adjust default zoom level in new canvas (no-changelog) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav authored and riascho committed Aug 26, 2024
1 parent 1db5858 commit 87fb43f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/editor-ui/src/components/canvas/Canvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand All @@ -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) {
Expand All @@ -298,7 +299,7 @@ async function onZoomOut() {
}
async function onResetZoom() {
await onZoomTo(1);
await onZoomTo(defaultZoom);
}
function onViewportChange(viewport: ViewportTransform) {
Expand Down

0 comments on commit 87fb43f

Please sign in to comment.