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 0fc614f commit 6c1a99c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
18 changes: 16 additions & 2 deletions packages/react-multi-crop/dist/index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,22 @@ var ReactMultiCrop = /*#__PURE__*/function (_Component) {
coord.rect = JSON.stringify(rectangle);

if (_typeof(canvas) === "object" && _typeof(canvas.backgroundImage) === "object" && canvas.backgroundImage) {
var imgWidth = canvas.backgroundImage.width;
var imgHeight = canvas.backgroundImage.height;
var canvasBackground = canvas.backgroundImage;

if (!fabric.fabric.Canvas.supports("toDataURL")) {
console.log("This browser doesn't provide means to serialize canvas to an image");
} else {
var dataUrl = canvasBackground.toDataURL({
height: element.height,
width: element.width,
left: element.left,
top: element.top
});
coord.dataUrl = dataUrl;
}

var imgWidth = canvasBackground.width;
var imgHeight = canvasBackground.height;
var x1Px = x1 * imgWidth;
var x2Px = x2 * imgWidth;
var y1Px = y1 * imgHeight;
Expand Down
18 changes: 16 additions & 2 deletions packages/react-multi-crop/dist/index.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,22 @@ var ReactMultiCrop = /*#__PURE__*/function (_Component) {
coord.rect = JSON.stringify(rectangle);

if (_typeof(canvas) === "object" && _typeof(canvas.backgroundImage) === "object" && canvas.backgroundImage) {
var imgWidth = canvas.backgroundImage.width;
var imgHeight = canvas.backgroundImage.height;
var canvasBackground = canvas.backgroundImage;

if (!fabric.Canvas.supports("toDataURL")) {
console.log("This browser doesn't provide means to serialize canvas to an image");
} else {
var dataUrl = canvasBackground.toDataURL({
height: element.height,
width: element.width,
left: element.left,
top: element.top
});
coord.dataUrl = dataUrl;
}

var imgWidth = canvasBackground.width;
var imgHeight = canvasBackground.height;
var x1Px = x1 * imgWidth;
var x2Px = x2 * imgWidth;
var y1Px = y1 * imgHeight;
Expand Down

0 comments on commit 6c1a99c

Please sign in to comment.