@threedddplus/logoeditor 0.0.75 → 0.0.77

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