@threedddplus/logoeditor 0.0.78 → 0.0.80
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.
- package/dist/logoeditor.cjs.development.js +22 -30
- package/dist/logoeditor.cjs.development.js.map +1 -1
- package/dist/logoeditor.cjs.production.min.js +1 -1
- package/dist/logoeditor.cjs.production.min.js.map +1 -1
- package/dist/logoeditor.esm.js +22 -30
- package/dist/logoeditor.esm.js.map +1 -1
- package/package.json +1 -1
@@ -4697,41 +4697,33 @@ var initCanvas = function initCanvas() {
|
|
4697
4697
|
var onObjectMoving = function onObjectMoving(e) {
|
4698
4698
|
use3dddPlus.getState().updateModifaction(false);
|
4699
4699
|
var obj = e.target;
|
4700
|
-
|
4701
|
-
|
4702
|
-
|
4700
|
+
var offsetLeft = 10;
|
4701
|
+
var offsetTop = 20;
|
4702
|
+
obj.setCoords();
|
4703
|
+
// var curZoom = obj.canvas.getZoom();
|
4704
|
+
if (obj.getScaledWidth() > obj.canvas.width) {
|
4705
|
+
//Objct width is too big
|
4706
|
+
// obj.scaleToWidth(obj.canvas.width - 100);
|
4707
|
+
return;
|
4703
4708
|
}
|
4704
|
-
if (
|
4705
|
-
|
4706
|
-
obj.
|
4709
|
+
if (obj.getScaledHeight() > obj.canvas.height) {
|
4710
|
+
//Objct height is too big
|
4711
|
+
// obj.scaleToHeight(obj.canvas.height - 100);
|
4712
|
+
return;
|
4707
4713
|
}
|
4708
|
-
|
4709
|
-
|
4710
|
-
// obj.getBoundingRect().width > obj.canvas.height ||
|
4711
|
-
// obj.getBoundingRect().height > obj.canvas.width
|
4712
|
-
// ) {
|
4713
|
-
// return;
|
4714
|
-
// }
|
4715
|
-
obj.setCoords();
|
4716
|
-
if (obj.getBoundingRect().top < 0 || obj.getBoundingRect().left < 0) {
|
4717
|
-
obj.top = Math.max(obj.top, obj.top - obj.getBoundingRect().top);
|
4718
|
-
obj.left = Math.max(obj.left, obj.left - obj.getBoundingRect().left);
|
4719
|
-
obj.setCoords();
|
4714
|
+
if (obj.oCoords.br.x >= obj.canvas.width) {
|
4715
|
+
obj.left = obj.left - (obj.oCoords.br.x - obj.canvas.width) - offsetLeft;
|
4720
4716
|
}
|
4721
|
-
if (obj.
|
4722
|
-
obj.top =
|
4723
|
-
obj.left = Math.min(obj.left, obj.canvas.width - obj.getBoundingRect().width + obj.left - obj.getBoundingRect().left);
|
4724
|
-
obj.setCoords();
|
4717
|
+
if (obj.oCoords.br.y >= obj.canvas.height) {
|
4718
|
+
obj.top = obj.top - (obj.oCoords.br.y - obj.canvas.height) - offsetTop;
|
4725
4719
|
}
|
4726
|
-
|
4727
|
-
|
4728
|
-
left1 = obj.left;
|
4729
|
-
top1 = obj.top;
|
4730
|
-
scale1x = obj.scaleX;
|
4731
|
-
scale1y = obj.scaleY;
|
4732
|
-
width1 = obj.width;
|
4733
|
-
height1 = obj.height;
|
4720
|
+
if (obj.left - obj.width * obj.scaleX / 2 < 0) {
|
4721
|
+
obj.left = offsetLeft + obj.width * obj.scaleX / 2;
|
4734
4722
|
}
|
4723
|
+
if (obj.top - obj.height * obj.scaleY / 2 < 0) {
|
4724
|
+
obj.top = offsetTop + obj.height * obj.scaleY / 2;
|
4725
|
+
}
|
4726
|
+
obj.setCoords();
|
4735
4727
|
if (isObjectInCenter(e.target)) {
|
4736
4728
|
use3dddPlus.getState().verticalLine.set({
|
4737
4729
|
visible: true
|