@threedddplus/logoeditor 0.0.73 → 0.0.75
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.
- package/dist/logoeditor.cjs.development.js +20 -13
- package/dist/logoeditor.cjs.development.js.map +1 -1
- package/dist/logoeditor.cjs.production.min.js +1 -1
- package/dist/logoeditor.cjs.production.min.js.map +1 -1
- package/dist/logoeditor.esm.js +20 -13
- package/dist/logoeditor.esm.js.map +1 -1
- package/package.json +1 -1
@@ -4697,22 +4697,28 @@ var initCanvas = function initCanvas() {
|
|
4697
4697
|
var onObjectMoving = function onObjectMoving(e) {
|
4698
4698
|
use3dddPlus.getState().updateModifaction(false);
|
4699
4699
|
var obj = e.target;
|
4700
|
-
if (isNaN(obj.left)) {
|
4701
|
-
obj.left = obj.left - 1;
|
4702
|
-
obj.setCoords();
|
4703
|
-
}
|
4704
|
-
if (isNaN(obj.top)) {
|
4705
|
-
obj.top = obj.top - 1;
|
4706
|
-
obj.setCoords();
|
4707
|
-
}
|
4708
|
-
console.log(e);
|
4709
4700
|
// if (
|
4710
4701
|
// obj.getBoundingRect().width > obj.canvas.height ||
|
4711
4702
|
// obj.getBoundingRect().height > obj.canvas.width
|
4712
4703
|
// ) {
|
4713
4704
|
// return;
|
4714
4705
|
// }
|
4706
|
+
var offsetLeft = 1;
|
4707
|
+
var offsetTop = 2;
|
4708
|
+
if (obj.oCoords.br.x >= obj.canvas.width) {
|
4709
|
+
obj.left = obj.left - (obj.oCoords.br.x - obj.canvas.width) - offsetLeft;
|
4710
|
+
}
|
4711
|
+
if (obj.oCoords.br.y >= obj.canvas.height) {
|
4712
|
+
obj.top = obj.top - (obj.oCoords.br.y - obj.canvas.height) - offsetTop;
|
4713
|
+
}
|
4714
|
+
if (obj.left - obj.width * obj.scaleX / 2 < 0) {
|
4715
|
+
obj.left = offsetLeft + obj.width * obj.scaleX / 2;
|
4716
|
+
}
|
4717
|
+
if (obj.top - obj.height * obj.scaleY / 2 < 0) {
|
4718
|
+
obj.top = offsetTop + obj.height * obj.scaleY / 2;
|
4719
|
+
}
|
4715
4720
|
obj.setCoords();
|
4721
|
+
console.log(e);
|
4716
4722
|
if (obj.getBoundingRect().top < 0 || obj.getBoundingRect().left < 0) {
|
4717
4723
|
obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top);
|
4718
4724
|
obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left);
|
@@ -4795,14 +4801,14 @@ var initCanvas = function initCanvas() {
|
|
4795
4801
|
return Math.abs(scaledObjCenterX - canvasCenterX) < threshold;
|
4796
4802
|
}
|
4797
4803
|
var horizontalLine = new fabric.fabric.Line([0, canv.height / 2, canv.height, canv.height / 2], {
|
4798
|
-
stroke:
|
4804
|
+
stroke: 'red',
|
4799
4805
|
scaleX: 11,
|
4800
4806
|
visible: false,
|
4801
4807
|
selectable: false,
|
4802
4808
|
type: 'line'
|
4803
4809
|
});
|
4804
4810
|
var verticalLine = new fabric.fabric.Line([canv.width / 2, 0, canv.width / 2, canv.width], {
|
4805
|
-
stroke:
|
4811
|
+
stroke: 'red',
|
4806
4812
|
visible: false,
|
4807
4813
|
selectable: false,
|
4808
4814
|
type: 'line'
|
@@ -4923,13 +4929,14 @@ var initCanvas = function initCanvas() {
|
|
4923
4929
|
}
|
4924
4930
|
|
4925
4931
|
var removeItem = function removeItem(value) {
|
4926
|
-
//@ts-ignore
|
4932
|
+
//@ts-ignore
|
4927
4933
|
var index = use3dddPlus.getState().storeAllObject.findIndex(function (obj) {
|
4928
4934
|
return obj.id === value.id;
|
4929
4935
|
});
|
4930
4936
|
if (index === -1 && value && value._objects && value._objects.length > 0) {
|
4937
|
+
var index = use3dddPlus.getState()
|
4931
4938
|
//@ts-ignore
|
4932
|
-
|
4939
|
+
.storeAllObject.indexOf(value._objects[0]);
|
4933
4940
|
}
|
4934
4941
|
if (index > -1) {
|
4935
4942
|
use3dddPlus.getState().storeAllObject.splice(index, 1);
|