@threedddplus/logoeditor 0.0.81 → 0.0.82

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,25 +4689,36 @@ 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 (
4693
- // obj.getBoundingRect().width > obj.canvas.height ||
4694
- // obj.getBoundingRect().height > obj.canvas.width
4695
- // ) {
4696
- // return;
4697
- // }
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);
4698
4699
  obj.setCoords();
4699
- if (obj.getBoundingRect().top < 0 || obj.getBoundingRect().left < 0) {
4700
- obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top);
4701
- obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left);
4700
+ debugger;
4701
+ console.log('after set correds', e);
4702
+ if (obj.getBoundingRect().top < 10 || obj.getBoundingRect().left < 45) {
4703
+ obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top + 10);
4704
+ obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left + 45);
4702
4705
  obj.setCoords();
4703
4706
  }
4704
- if (obj.getBoundingRect().top + obj.getBoundingRect().height > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width > obj.canvas.width) {
4705
- obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top);
4706
- obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left);
4707
+ if (obj.getBoundingRect().top + obj.getBoundingRect().height + 10 > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width + 45 > obj.canvas.width) {
4708
+ obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top - 10);
4709
+ obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left - 45);
4707
4710
  obj.setCoords();
4708
4711
  }
4709
4712
  var brNew = obj.getBoundingRect();
4710
- if (brNew.width + brNew.left >= obj.canvas.width || brNew.height + brNew.top >= obj.canvas.height || brNew.left < 0 || brNew.top < 0) ; else {
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
4722
  left1 = obj.left;
4712
4723
  top1 = obj.top;
4713
4724
  scale1x = obj.scaleX;