Skip to content

Commit b13dd33

Browse files
authored
okay now im lost. it works in my console but not here
1 parent 0da1ede commit b13dd33

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/helper/tools/text-tool.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,13 @@ class TextTool extends paper.Tool {
186186
// edge. We need to correct for this in order for the element to overlap the object in paper.
187187
let tx = 0;
188188
if (this.element.parentElement) {
189-
tx = -this.textBox.internalBounds.x;
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);
190196
}
191197

192198
// Start by translating the element up so that its (0, 0) is now at the text baseline, like in paper

0 commit comments

Comments
 (0)