MCPcopy
hub / github.com/MinJieLiu/react-photo-view / limitScale

Function limitScale

packages/react-photo-view/src/utils/limitTarget.ts:10–12  ·  view source on GitHub ↗
(scale: number, max: number = 0, buffer: number = 0)

Source from the content-addressed store, hash-verified

8 * 限制最大/最小缩放
9 */
10export const limitScale = (scale: number, max: number = 0, buffer: number = 0) => {
11 return limitNumber(scale, minScale * (1 - buffer), Math.max(maxScale, max) * (1 + buffer));
12};

Callers 3

PhotoBoxFunction · 0.90
handleUpFunction · 0.90
handleWheelFunction · 0.90

Calls 1

limitNumberFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…