Skip to content

Commit

Permalink
fix: Lift the minimum scale on reset viewport
Browse files Browse the repository at this point in the history
- It's not so important nor so intuitive
  • Loading branch information
miyanokomiya committed Apr 16, 2024
1 parent 03f387d commit d33a95c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ export function useCanvas(
return;
}

const ret = centerizeView(expandRect(rect, margin / scale), viewSize, (v) => clamp(1, scaleMax, v));
const ret = centerizeView(expandRect(rect, margin / scale), viewSize, (v) => clamp(scaleMin, scaleMax, v));
setScale(ret.scale);
setViewOrigin(ret.viewOrigin);
},
[scale, scaleMax, adjustToCenter, viewSize, setViewOrigin, setScale],
[scale, scaleMin, scaleMax, adjustToCenter, viewSize, setViewOrigin, setScale],
);

const zoomView = useCallback(
Expand Down

0 comments on commit d33a95c

Please sign in to comment.