react-design-editor 0.0.54 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -194261,6 +194261,8 @@ var WorkareaHandler_WorkareaHandler = /*#__PURE__*/function () {
|
|
|
194261
194261
|
|
|
194262
194262
|
canvas.renderAll();
|
|
194263
194263
|
resolve(workarea);
|
|
194264
|
+
}, {
|
|
194265
|
+
crossOrigin: 'anonymous'
|
|
194264
194266
|
});
|
|
194265
194267
|
}));
|
|
194266
194268
|
|
|
@@ -199439,6 +199441,22 @@ var AlignmentHandler_AlignmentHandler = /*#__PURE__*/createClass_default()(funct
|
|
|
199439
199441
|
}
|
|
199440
199442
|
};
|
|
199441
199443
|
|
|
199444
|
+
this.middle = function () {
|
|
199445
|
+
var activeObject = _this.handler.canvas.getActiveObject();
|
|
199446
|
+
|
|
199447
|
+
if (activeObject && activeObject.type === 'activeSelection') {
|
|
199448
|
+
var activeSelection = activeObject;
|
|
199449
|
+
activeSelection.forEachObject(function (obj) {
|
|
199450
|
+
obj.set({
|
|
199451
|
+
top: 0 - obj.width * obj.scaleX / 2
|
|
199452
|
+
});
|
|
199453
|
+
obj.setCoords();
|
|
199454
|
+
|
|
199455
|
+
_this.handler.canvas.renderAll();
|
|
199456
|
+
});
|
|
199457
|
+
}
|
|
199458
|
+
};
|
|
199459
|
+
|
|
199442
199460
|
this.right = function () {
|
|
199443
199461
|
var activeObject = _this.handler.canvas.getActiveObject();
|
|
199444
199462
|
|
|
@@ -202182,7 +202200,8 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
202182
202200
|
resolve(obj.setSrc(source, function () {
|
|
202183
202201
|
return _this.canvas.renderAll();
|
|
202184
202202
|
}, {
|
|
202185
|
-
dirty: true
|
|
202203
|
+
dirty: true,
|
|
202204
|
+
crossOrigin: "anonymous"
|
|
202186
202205
|
}));
|
|
202187
202206
|
}
|
|
202188
202207
|
});
|
|
@@ -203463,16 +203482,21 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
203463
203482
|
format: 'png',
|
|
203464
203483
|
quality: 1
|
|
203465
203484
|
};
|
|
203466
|
-
|
|
203467
203485
|
// If it's zoomed out/in, the container will also include in the image
|
|
203468
203486
|
// hence need to reset the zoom level.
|
|
203469
|
-
_this.zoomHandler.zoomOneToOne();
|
|
203470
|
-
|
|
203471
203487
|
var _this$workarea2 = _this.workarea,
|
|
203472
203488
|
left = _this$workarea2.left,
|
|
203473
203489
|
top = _this$workarea2.top,
|
|
203474
203490
|
width = _this$workarea2.width,
|
|
203475
|
-
height = _this$workarea2.height
|
|
203491
|
+
height = _this$workarea2.height,
|
|
203492
|
+
scaleX = _this$workarea2.scaleX,
|
|
203493
|
+
scaleY = _this$workarea2.scaleY;
|
|
203494
|
+
width = Math.ceil(width * scaleX);
|
|
203495
|
+
height = Math.ceil(height * scaleY); // cachedVT is used to reset the viewportTransform after the image is saved.
|
|
203496
|
+
|
|
203497
|
+
var cachedVT = _this.canvas.viewportTransform; // reset the viewportTransform to default (no zoom)
|
|
203498
|
+
|
|
203499
|
+
_this.canvas.viewportTransform = [1, 0, 0, 1, 0, 0];
|
|
203476
203500
|
|
|
203477
203501
|
var dataUrl = _this.canvas.toDataURL(Handler_objectSpread(Handler_objectSpread({}, option), {}, {
|
|
203478
203502
|
left: left,
|
|
@@ -203489,7 +203513,10 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
203489
203513
|
document.body.appendChild(anchorEl);
|
|
203490
203514
|
anchorEl.click();
|
|
203491
203515
|
anchorEl.remove();
|
|
203492
|
-
}
|
|
203516
|
+
} // reset the viewportTransform to previous value.
|
|
203517
|
+
|
|
203518
|
+
|
|
203519
|
+
_this.canvas.viewportTransform = cachedVT;
|
|
203493
203520
|
};
|
|
203494
203521
|
|
|
203495
203522
|
this.rotate = function (angle) {
|