@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.
@@ -4689,16 +4689,14 @@ var initCanvas = function initCanvas() {
4689
4689
  var onObjectMoving = function onObjectMoving(e) {
4690
4690
  use3dddPlus.getState().updateModifaction(false);
4691
4691
  var obj = e.target;
4692
- if (obj.left < 0 || isNaN(obj.left)) {
4693
- obj.left = 0;
4694
- }
4695
- if (obj.top < 0 || isNaN(obj.top)) {
4696
- obj.top = 0;
4697
- }
4698
- console.log('before set Corrds', e);
4692
+ // if (
4693
+ // obj.getBoundingRect().width > obj.canvas.height ||
4694
+ // obj.getBoundingRect().height > obj.canvas.width
4695
+ // ) {
4696
+ // return;
4697
+ // }
4698
+ console.log(e);
4699
4699
  obj.setCoords();
4700
- debugger;
4701
- console.log('after set correds', e);
4702
4700
  if (obj.getBoundingRect().top < 10 || obj.getBoundingRect().left < 45) {
4703
4701
  obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top + 10);
4704
4702
  obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left + 45);
@@ -4710,15 +4708,7 @@ var initCanvas = function initCanvas() {
4710
4708
  obj.setCoords();
4711
4709
  }
4712
4710
  var brNew = obj.getBoundingRect();
4713
- if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) {
4714
- console.log(obj.left, obj.top, obj.scaleX, obj.scaleY, obj.width, obj.height);
4715
- // obj.left = left1;
4716
- // obj.top = top1;
4717
- // obj.scaleX = scale1x;
4718
- // obj.scaleY = scale1y;
4719
- // obj.width = width1;
4720
- // obj.height = height1;
4721
- } else {
4711
+ if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) ; else {
4722
4712
  left1 = obj.left;
4723
4713
  top1 = obj.top;
4724
4714
  scale1x = obj.scaleX;
@@ -5023,7 +5013,7 @@ var initCanvas = function initCanvas() {
5023
5013
  var obj = e.target;
5024
5014
  obj.setCoords();
5025
5015
  var brNew = obj.getBoundingRect();
5026
- if (brNew.width + brNew.left >= obj.canvas.width || brNew.height + brNew.top >= obj.canvas.height || brNew.left < 0 || brNew.top < 0) {
5016
+ if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) {
5027
5017
  obj.left = left1;
5028
5018
  obj.top = top1;
5029
5019
  obj.scaleX = scale1x;
@@ -6140,6 +6130,7 @@ var PopUpCanvas = function PopUpCanvas() {
6140
6130
  }, 100);
6141
6131
  }
6142
6132
  }
6133
+ setColorFillCount(-1);
6143
6134
  }, [colorFill]);
6144
6135
  useEffect(function () {
6145
6136
  if (colorFillCount && colorFillCount > 0) {
@@ -8627,7 +8618,7 @@ var Rightmenu = function Rightmenu() {
8627
8618
  // brNew = dublicateText.getBoundingRect();
8628
8619
  // }
8629
8620
  var brNew = dublicateText.getBoundingRect();
8630
- if (brNew.width + brNew.left >= textSelected.canvas.width || brNew.height + brNew.top >= textSelected.canvas.height || brNew.left < 0 || brNew.top < 0) {
8621
+ if (brNew.width + brNew.left + 45 >= textSelected.canvas.width || brNew.height + brNew.top + 10 >= textSelected.canvas.height || brNew.left < 45 || brNew.top < 10) {
8631
8622
  if (currentSelection === 'path') {
8632
8623
  textSelected.set('fontSize', event.target.value - (Math.sign(toReduceSize) >= 0 ? toReduceSize : 1));
8633
8624
  textShapeChange(textSelected.shapeType, true);
@@ -8731,8 +8722,11 @@ var Rightmenu = function Rightmenu() {
8731
8722
  };
8732
8723
  var textSpacingHandler = function textSpacingHandler(e) {
8733
8724
  // setSpacinglineVal(e.target.valueAsNumber);
8734
- var brNew = textSelected.getBoundingRect();
8735
- if (brNew.width + brNew.left >= textSelected.canvas.width || brNew.height + brNew.top >= textSelected.canvas.height || brNew.left < 0 || brNew.top < 0) {
8725
+ var dublicateText = textSelected;
8726
+ var oldCharSpacing = dublicateText.charSpacing;
8727
+ dublicateText.charSpacing = e.target.valueAsNumber;
8728
+ var brNew = dublicateText.getBoundingRect();
8729
+ if (brNew.width + brNew.left + 45 >= dublicateText.canvas.width || brNew.height + brNew.top >= dublicateText.canvas.height || brNew.left < 0 || brNew.top < 0) {
8736
8730
  if (textSelected.charSpacing > e.target.valueAsNumber) {
8737
8731
  textSelected.charSpacing = e.target.valueAsNumber;
8738
8732
  if (currentSelection === 'path') {
@@ -8754,6 +8748,10 @@ var Rightmenu = function Rightmenu() {
8754
8748
  use3dddPlus.getState().updateModifaction(true);
8755
8749
  use3dddPlus.getState().forIconCapture();
8756
8750
  textSelected.icon = use3dddPlus.getState().iconImage;
8751
+ var _brNew = textSelected.getBoundingRect();
8752
+ if (_brNew.width + _brNew.left + 45 >= dublicateText.canvas.width || _brNew.height + _brNew.top >= dublicateText.canvas.height || _brNew.left < 0 || _brNew.top < 0) {
8753
+ textSelected.charSpacing = oldCharSpacing;
8754
+ }
8757
8755
  canvas.renderAll();
8758
8756
  if (textSelected.aCoords.tr.x > 480) {
8759
8757
  return;