Skip to content

Commit

Permalink
Build Project
Browse files Browse the repository at this point in the history
  • Loading branch information
berviantoleo committed Nov 28, 2020
1 parent 3017d3e commit e18e555
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 8 deletions.
26 changes: 22 additions & 4 deletions packages/react-multi-crop/dist/index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,30 @@ var ReactMultiCrop = /*#__PURE__*/function (_Component) {
zoom *= Math.pow(0.999, delta);
if (zoom > 20) zoom = 20;
if (zoom < 0.01) zoom = 0.01;
canvas.setZoom(zoom);
canvas.zoomToPoint({
x: options.e.offsetX,
y: options.e.offsetY
}, zoom);
options.e.preventDefault();
options.e.stopPropagation();
this.setState({
canvas: canvas
});
var vpt = canvas.viewportTransform;

if (zoom < 400 / 1000) {
vpt[4] = 200 - 1000 * zoom / 2;
vpt[5] = 200 - 1000 * zoom / 2;
} else {
if (vpt[4] >= 0) {
vpt[4] = 0;
} else if (vpt[4] < canvas.getWidth() - 1000 * zoom) {
vpt[4] = canvas.getWidth() - 1000 * zoom;
}

if (vpt[5] >= 0) {
vpt[5] = 0;
} else if (vpt[5] < canvas.getHeight() - 1000 * zoom) {
vpt[5] = canvas.getHeight() - 1000 * zoom;
}
}
}
}, {
key: "initialCanvas",
Expand Down
26 changes: 22 additions & 4 deletions packages/react-multi-crop/dist/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,30 @@ var ReactMultiCrop = /*#__PURE__*/function (_Component) {
zoom *= Math.pow(0.999, delta);
if (zoom > 20) zoom = 20;
if (zoom < 0.01) zoom = 0.01;
canvas.setZoom(zoom);
canvas.zoomToPoint({
x: options.e.offsetX,
y: options.e.offsetY
}, zoom);
options.e.preventDefault();
options.e.stopPropagation();
this.setState({
canvas: canvas
});
var vpt = canvas.viewportTransform;

if (zoom < 400 / 1000) {
vpt[4] = 200 - 1000 * zoom / 2;
vpt[5] = 200 - 1000 * zoom / 2;
} else {
if (vpt[4] >= 0) {
vpt[4] = 0;
} else if (vpt[4] < canvas.getWidth() - 1000 * zoom) {
vpt[4] = canvas.getWidth() - 1000 * zoom;
}

if (vpt[5] >= 0) {
vpt[5] = 0;
} else if (vpt[5] < canvas.getHeight() - 1000 * zoom) {
vpt[5] = canvas.getHeight() - 1000 * zoom;
}
}
}
}, {
key: "initialCanvas",
Expand Down

0 comments on commit e18e555

Please sign in to comment.