@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.
@@ -4697,36 +4697,26 @@ 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
- if (obj.getBoundingRect().top < 10 || obj.getBoundingRect().left < 45) {
4711
- obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top + 10);
4712
- obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left + 45);
4708
+ if (obj.getBoundingRect().top < 0 || obj.getBoundingRect().left < 0) {
4709
+ obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top);
4710
+ obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left);
4713
4711
  obj.setCoords();
4714
4712
  }
4715
- if (obj.getBoundingRect().top + obj.getBoundingRect().height + 10 > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width + 45 > obj.canvas.width) {
4716
- obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top - 10);
4717
- obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left - 45);
4713
+ if (obj.getBoundingRect().top + obj.getBoundingRect().height > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width > obj.canvas.width) {
4714
+ obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top);
4715
+ obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left);
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 >= obj.canvas.width || brNew.height + brNew.top >= obj.canvas.height || brNew.left < 0 || brNew.top < 0) ; else {
4730
4720
  left1 = obj.left;
4731
4721
  top1 = obj.top;
4732
4722
  scale1x = obj.scaleX;