@threedddplus/logoeditor 0.0.82 → 0.0.84

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,16 +4697,14 @@ 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 (obj.left < 0 || isNaN(obj.left)) {
4701
- obj.left = 0;
4702
- }
4703
- if (obj.top < 0 || isNaN(obj.top)) {
4704
- obj.top = 0;
4705
- }
4706
- console.log('before set Corrds', e);
4700
+ // if (
4701
+ // obj.getBoundingRect().width > obj.canvas.height ||
4702
+ // obj.getBoundingRect().height > obj.canvas.width
4703
+ // ) {
4704
+ // return;
4705
+ // }
4706
+ console.log(e);
4707
4707
  obj.setCoords();
4708
- debugger;
4709
- console.log('after set correds', e);
4710
4708
  if (obj.getBoundingRect().top < 10 || obj.getBoundingRect().left < 45) {
4711
4709
  obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top + 10);
4712
4710
  obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left + 45);
@@ -4718,15 +4716,7 @@ var initCanvas = function initCanvas() {
4718
4716
  obj.setCoords();
4719
4717
  }
4720
4718
  var brNew = obj.getBoundingRect();
4721
- if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) {
4722
- console.log(obj.left, obj.top, obj.scaleX, obj.scaleY, obj.width, obj.height);
4723
- // obj.left = left1;
4724
- // obj.top = top1;
4725
- // obj.scaleX = scale1x;
4726
- // obj.scaleY = scale1y;
4727
- // obj.width = width1;
4728
- // obj.height = height1;
4729
- } else {
4719
+ if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) ; else {
4730
4720
  left1 = obj.left;
4731
4721
  top1 = obj.top;
4732
4722
  scale1x = obj.scaleX;
@@ -5031,7 +5021,7 @@ var initCanvas = function initCanvas() {
5031
5021
  var obj = e.target;
5032
5022
  obj.setCoords();
5033
5023
  var brNew = obj.getBoundingRect();
5034
- if (brNew.width + brNew.left >= obj.canvas.width || brNew.height + brNew.top >= obj.canvas.height || brNew.left < 0 || brNew.top < 0) {
5024
+ if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) {
5035
5025
  obj.left = left1;
5036
5026
  obj.top = top1;
5037
5027
  obj.scaleX = scale1x;
@@ -6148,6 +6138,7 @@ var PopUpCanvas = function PopUpCanvas() {
6148
6138
  }, 100);
6149
6139
  }
6150
6140
  }
6141
+ setColorFillCount(-1);
6151
6142
  }, [colorFill]);
6152
6143
  React.useEffect(function () {
6153
6144
  if (colorFillCount && colorFillCount > 0) {
@@ -8635,7 +8626,7 @@ var Rightmenu = function Rightmenu() {
8635
8626
  // brNew = dublicateText.getBoundingRect();
8636
8627
  // }
8637
8628
  var brNew = dublicateText.getBoundingRect();
8638
- if (brNew.width + brNew.left >= textSelected.canvas.width || brNew.height + brNew.top >= textSelected.canvas.height || brNew.left < 0 || brNew.top < 0) {
8629
+ if (brNew.width + brNew.left + 45 >= textSelected.canvas.width || brNew.height + brNew.top + 10 >= textSelected.canvas.height || brNew.left < 45 || brNew.top < 10) {
8639
8630
  if (currentSelection === 'path') {
8640
8631
  textSelected.set('fontSize', event.target.value - (Math.sign(toReduceSize) >= 0 ? toReduceSize : 1));
8641
8632
  textShapeChange(textSelected.shapeType, true);
@@ -8739,8 +8730,11 @@ var Rightmenu = function Rightmenu() {
8739
8730
  };
8740
8731
  var textSpacingHandler = function textSpacingHandler(e) {
8741
8732
  // setSpacinglineVal(e.target.valueAsNumber);
8742
- var brNew = textSelected.getBoundingRect();
8743
- if (brNew.width + brNew.left >= textSelected.canvas.width || brNew.height + brNew.top >= textSelected.canvas.height || brNew.left < 0 || brNew.top < 0) {
8733
+ var dublicateText = textSelected;
8734
+ var oldCharSpacing = dublicateText.charSpacing;
8735
+ dublicateText.charSpacing = e.target.valueAsNumber;
8736
+ var brNew = dublicateText.getBoundingRect();
8737
+ if (brNew.width + brNew.left + 45 >= dublicateText.canvas.width || brNew.height + brNew.top >= dublicateText.canvas.height || brNew.left < 0 || brNew.top < 0) {
8744
8738
  if (textSelected.charSpacing > e.target.valueAsNumber) {
8745
8739
  textSelected.charSpacing = e.target.valueAsNumber;
8746
8740
  if (currentSelection === 'path') {
@@ -8762,6 +8756,10 @@ var Rightmenu = function Rightmenu() {
8762
8756
  use3dddPlus.getState().updateModifaction(true);
8763
8757
  use3dddPlus.getState().forIconCapture();
8764
8758
  textSelected.icon = use3dddPlus.getState().iconImage;
8759
+ var _brNew = textSelected.getBoundingRect();
8760
+ if (_brNew.width + _brNew.left + 45 >= dublicateText.canvas.width || _brNew.height + _brNew.top >= dublicateText.canvas.height || _brNew.left < 0 || _brNew.top < 0) {
8761
+ textSelected.charSpacing = oldCharSpacing;
8762
+ }
8765
8763
  canvas.renderAll();
8766
8764
  if (textSelected.aCoords.tr.x > 480) {
8767
8765
  return;