Skip to content

Commit bff8fb8

Browse files
authored
text-tool.js -- call debug to fix aligned text tool bug
1 parent 6ec78a0 commit bff8fb8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/helper/tools/text-tool.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ class TextTool extends paper.Tool {
180180
// edge. We need to correct for this in order for the element to overlap the object in paper.
181181
let tx = 0;
182182
if ((this.alignment === "right") && this.element.parentElement) {
183-
tx = -this.element.parentElement.clientWidth;
183+
if (window.test) tx = window.test({}, this, textBoxMtx);
184+
else tx = -this.element.parentElement.clientWidth;
184185
}
185186
if ((this.alignment === "center") && this.element.parentElement) {
186187
const bounds = this.textBox.getBounds();
187-
tx = bounds.x / (1 + paper.view.zoom * 0.5);
188+
if (window.test) tx = window.test(bounds, this, textBoxMtx);
189+
else tx = bounds.x / (1 + paper.view.zoom * 0.5);
188190
}
189191
// The transform origin in paper is x at justification side, y at the baseline of the text.
190192
// The offset from (0, 0) to the upper left corner is recorded by internalBounds

0 commit comments

Comments
 (0)