Skip to content

Commit

Permalink
Merge pull request #92 from frappe/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Feb 28, 2024
2 parents 38ba6a6 + fbd77bf commit 2d26bdd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions frontend/src/components/BuilderCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -349,20 +349,14 @@ const setScaleAndTranslate = async () => {
});
}
const paddingX = 300;
const paddingY = 400;
const paddingY = 200;
await nextTick();
canvasBound.update();
const containerWidth = containerBound.width;
const containerHeight = containerBound.height;
const canvasWidth = canvasBound.width / canvasProps.scale;
const canvasHeight = canvasBound.height / canvasProps.scale;
canvasProps.scale = Math.min(
containerWidth / (canvasWidth + paddingX * 2),
containerHeight / (canvasHeight + paddingY * 2)
);
canvasProps.scale = containerWidth / (canvasWidth + paddingX * 2);
canvasProps.translateX = 0;
canvasProps.translateY = 0;
Expand Down

0 comments on commit 2d26bdd

Please sign in to comment.