@threedddplus/logoeditor 0.0.82 → 0.0.83

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,36 +4689,26 @@ 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
- 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);
4700
+ if (obj.getBoundingRect().top < 0 || obj.getBoundingRect().left < 0) {
4701
+ obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top);
4702
+ obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left);
4705
4703
  obj.setCoords();
4706
4704
  }
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);
4705
+ if (obj.getBoundingRect().top + obj.getBoundingRect().height > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width > obj.canvas.width) {
4706
+ obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top);
4707
+ obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left);
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 >= obj.canvas.width || brNew.height + brNew.top >= obj.canvas.height || brNew.left < 0 || brNew.top < 0) ; else {
4722
4712
  left1 = obj.left;
4723
4713
  top1 = obj.top;
4724
4714
  scale1x = obj.scaleX;