Skip to content

Commit 53dad8f

Browse files
authored
now, fix. 100%
1 parent b13dd33 commit 53dad8f

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

src/helper/tools/text-tool.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,21 +182,8 @@ class TextTool extends paper.Tool {
182182
// Move the transform origin down to the text baseline to match paper
183183
this.element.style.transformOrigin = `${-this.textBox.internalBounds.x}px ${-this.textBox.internalBounds.y}px`;
184184

185-
// In RTL, the element is moved relative to its parent's right edge instead of its left
186-
// edge. We need to correct for this in order for the element to overlap the object in paper.
187-
let tx = 0;
188-
if (this.element.parentElement) {
189-
if (this.alignment === "right") {
190-
tx = -this.textBox.internalBounds.x * 2;
191-
}
192-
if (this.alignment === "center") {
193-
tx = -this.textBox.internalBounds.x * 2;
194-
}
195-
if (window.test) tx = window.test(this);
196-
}
197-
198185
// Start by translating the element up so that its (0, 0) is now at the text baseline, like in paper
199-
calculated.translate(tx, this.textBox.internalBounds.y);
186+
calculated.translate(this.textBox.internalBounds.x, this.textBox.internalBounds.y);
200187
calculated.append(viewMtx);
201188
calculated.append(textBoxMtx);
202189
this.element.style.transform = `matrix(${calculated.a}, ${calculated.b}, ${calculated.c}, ${calculated.d},

0 commit comments

Comments
 (0)