@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.
@@ -4697,25 +4697,36 @@ 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 (
4701
- // obj.getBoundingRect().width > obj.canvas.height ||
4702
- // obj.getBoundingRect().height > obj.canvas.width
4703
- // ) {
4704
- // return;
4705
- // }
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);
4706
4707
  obj.setCoords();
4707
- if (obj.getBoundingRect().top < 0 || obj.getBoundingRect().left < 0) {
4708
- obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top);
4709
- obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left);
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);
4710
4713
  obj.setCoords();
4711
4714
  }
4712
- if (obj.getBoundingRect().top + obj.getBoundingRect().height > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width > obj.canvas.width) {
4713
- obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top);
4714
- obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left);
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);
4715
4718
  obj.setCoords();
4716
4719
  }
4717
4720
  var brNew = obj.getBoundingRect();
4718
- if (brNew.width + brNew.left >= obj.canvas.width || brNew.height + brNew.top >= obj.canvas.height || brNew.left < 0 || brNew.top < 0) ; else {
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
4730
  left1 = obj.left;
4720
4731
  top1 = obj.top;
4721
4732
  scale1x = obj.scaleX;