penpot/frontend
alonso.torres c5c60e466b 🐛 Measure a text in the element its renderer mounted
In the SVG renderer, a text inside a component kept drawing its old
font weight after a font weight token changed: the Design panel showed
the new weight, the canvas the old one, also after a reload.

A changed text is measured in a hidden HTML element, looked up in the
document by `#html-text-node-<id>`. While a layout reflows, the text
modifiers renderer mounts an element with the same id for the same
text, ahead of the changes renderer's one. The measurement found that
transient element; when a font variant had to load first, it was gone
by the time the measurement ran, so the position data came out empty
and was dropped, and nothing measured the text again. Texts in boards
with layout, as component mains usually are, take that path; others
did not.

`calc-position-data` now measures the element the renderer passes,
never one looked up by id.

Found by the components Qase run (PENPOT-2562).

Checked in the browser: cycling the font weight token of a main and its
copy through weights not loaded yet (300, 700, 200, 900, 600 italic,
300) redraws both with each new weight; before, the first use of each
weight kept the old one.

AI-assisted-by: claude-opus-5-5
2026-11-19 10:13:59 +01:00
..
2026-11-20 09:53:37 +01:00
2026-04-07 21:35:00 +02:00
2026-11-20 09:53:37 +01:00
2026-11-20 09:53:37 +01:00
2026-11-20 09:53:37 +01:00
2026-11-20 09:53:37 +01:00