@threedddplus/logoeditor 0.0.84 → 0.0.85

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,26 +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
- // }
4706
- console.log(e);
4707
- obj.setCoords();
4708
- if (obj.getBoundingRect().top < 10 || obj.getBoundingRect().left < 45) {
4700
+ if (obj.getBoundingRect().top < 10) {
4701
+ console.log('top < 10', obj.getBoundingRect().top < 10);
4709
4702
  obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top + 10);
4703
+ obj.setCoords();
4704
+ }
4705
+ if (obj.getBoundingRect().left < 45) {
4706
+ console.log('left < 45', obj.getBoundingRect().left < 45);
4710
4707
  obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left + 45);
4711
4708
  obj.setCoords();
4712
4709
  }
4713
- if (obj.getBoundingRect().top + obj.getBoundingRect().height + 10 > obj.canvas.height || obj.getBoundingRect().left + obj.getBoundingRect().width + 45 > obj.canvas.width) {
4710
+ if (obj.getBoundingRect().top + obj.getBoundingRect().height + 10 > obj.canvas.height) {
4711
+ console.log(' top> obj.canvas.height ', obj.getBoundingRect().top + obj.getBoundingRect().height + 10 > obj.canvas.height);
4714
4712
  obj.top = Math.min(obj.top, obj.canvas.height - obj.getBoundingRect().height + obj.top - obj.getBoundingRect().top - 10);
4713
+ obj.setCoords();
4714
+ }
4715
+ if (obj.getBoundingRect().left + obj.getBoundingRect().width + 45 > obj.canvas.width) {
4716
+ console.log('left > obj.canvas.width', obj.getBoundingRect().left + obj.getBoundingRect().width + 45 > obj.canvas.width);
4715
4717
  obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left - 45);
4716
4718
  obj.setCoords();
4717
4719
  }
4718
4720
  var brNew = obj.getBoundingRect();
4719
- if (brNew.width + brNew.left + 45 >= obj.canvas.width || brNew.height + brNew.top + 10 >= obj.canvas.height || brNew.left < 45 || brNew.top < 10) ; 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('if condition');
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 {
4720
4730
  left1 = obj.left;
4721
4731
  top1 = obj.top;
4722
4732
  scale1x = obj.scaleX;