Skip to content

Commit 4be03da

Browse files
committed
Update for 11.296
1 parent de90e31 commit 4be03da

File tree

2 files changed

+4
-28
lines changed

2 files changed

+4
-28
lines changed

module.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"email": "dev7355608@gmail.com"
1010
}
1111
],
12-
"version": "2.0.9",
12+
"version": "2.0.10",
1313
"compatibility": {
1414
"minimum": "10",
1515
"verified": "11"
@@ -28,8 +28,8 @@
2828
},
2929
"url": "https://github.com/dev7355608/advanced-drawing-tools",
3030
"manifest": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/module.json",
31-
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.9/module.zip",
32-
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.9",
31+
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.10/module.zip",
32+
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.10",
3333
"bugs": "https://github.com/dev7355608/advanced-drawing-tools/issues",
3434
"readme": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/README.md",
3535
"license": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/LICENSE"

scripts/index.js

+1-25
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,7 @@ Hooks.once("libWrapper.Ready", () => {
4747
}, libWrapper.OVERRIDE);
4848
} else {
4949
Drawing.prototype._rescaleDimensions = function (original, dx, dy) {
50-
let { points, width, height } = original.shape;
51-
width += dx;
52-
height += dy;
53-
points = points || [];
54-
55-
// Rescale polygon points
56-
if (this.isPolygon) {
57-
const scaleX = 1 + (dx / original.shape.width);
58-
const scaleY = 1 + (dy / original.shape.height);
59-
points = points.map((p, i) => p * (i % 2 ? scaleY : scaleX));
60-
}
61-
62-
// Constrain drawing bounds by the contained text size
63-
if (this.document.text) {
64-
const textBounds = this.text.getLocalBounds();
65-
width = Math.max(textBounds.width + 16, width);
66-
height = Math.max(textBounds.height + 8, height);
67-
}
68-
69-
// Normalize the shape
70-
return this.constructor.normalizeShape({
71-
x: original.x,
72-
y: original.y,
73-
shape: { width: Math.round(width), height: Math.round(height), points }
74-
});
50+
return Drawing.rescaleDimensions(original, dx, dy);
7551
};
7652
}
7753
});

0 commit comments

Comments
 (0)