I'm having trouble to place a text element at a certain position. According to this issue, changing the font after adding a text element makes positioning a bit harder.
Seems to me like positioning would be correct if I could set the font before calling draw.text()
.
Can I do that? How?
Thanks in advance.
Update: I realized some weird stuff when I was creating a CodeSandBox to improve my question. Check it out:
I created a rectangle as big as the image, another rectangle 20px smaller on each edge and placed it inside the other, and a text element moved 20px down.
It should align with the inner rect
. However, by inspecting it, it can be seen that it moved less than 20px down. The weird thing is that, when the x
parameter of move
is changed, it moves vertically and snaps to the correct position! However, when the preview is reloaded, the y
position reverts to the wrong position.
None the less, it gave me an idea...