Skip to content

Commit 5294018

Browse files
max scale to 1 - on fitting
1 parent b2fb8c5 commit 5294018

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

editor-packages/editor-canvas/math/center-of.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function centerOf(
4343
// center of the box, viewbound not considered.
4444
const boxcenter: XY = [(x1 + x2) / 2, (y1 + y2) / 2];
4545
// scale factor to fix the box to the viewbound.
46-
const scale = scaleToFit(box, viewbound);
46+
const scale = Math.min(scaleToFit(box, viewbound), 1); // no need to zoom-in
4747
// center of the viewbound.
4848
const vbcenter: XY = [
4949
viewbound[0] + (viewbound[0] + viewbound[2]) / 2,

0 commit comments

Comments
 (0)