Skip to content

Commit

Permalink
Update for 11.296
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed May 7, 2023
1 parent de90e31 commit 4be03da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"email": "[email protected]"
}
],
"version": "2.0.9",
"version": "2.0.10",
"compatibility": {
"minimum": "10",
"verified": "11"
Expand All @@ -28,8 +28,8 @@
},
"url": "https://github.com/dev7355608/advanced-drawing-tools",
"manifest": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/module.json",
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.9/module.zip",
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.9",
"download": "https://github.com/dev7355608/advanced-drawing-tools/releases/download/v2.0.10/module.zip",
"changelog": "https://github.com/dev7355608/advanced-drawing-tools/releases/tag/v2.0.10",
"bugs": "https://github.com/dev7355608/advanced-drawing-tools/issues",
"readme": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/README.md",
"license": "https://raw.githubusercontent.com/dev7355608/advanced-drawing-tools/main/LICENSE"
Expand Down
26 changes: 1 addition & 25 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,7 @@ Hooks.once("libWrapper.Ready", () => {
}, libWrapper.OVERRIDE);
} else {
Drawing.prototype._rescaleDimensions = function (original, dx, dy) {
let { points, width, height } = original.shape;
width += dx;
height += dy;
points = points || [];

// Rescale polygon points
if (this.isPolygon) {
const scaleX = 1 + (dx / original.shape.width);
const scaleY = 1 + (dy / original.shape.height);
points = points.map((p, i) => p * (i % 2 ? scaleY : scaleX));
}

// Constrain drawing bounds by the contained text size
if (this.document.text) {
const textBounds = this.text.getLocalBounds();
width = Math.max(textBounds.width + 16, width);
height = Math.max(textBounds.height + 8, height);
}

// Normalize the shape
return this.constructor.normalizeShape({
x: original.x,
y: original.y,
shape: { width: Math.round(width), height: Math.round(height), points }
});
return Drawing.rescaleDimensions(original, dx, dy);
};
}
});
Expand Down

0 comments on commit 4be03da

Please sign in to comment.