mirror of
https://github.com/penpot/penpot.git
synced 2026-11-23 19:00:36 +00:00
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