A child of a turned parent first scales with the parent's resize, and
its constraints then scale it back. The scale back divided by the
child's scaled width with a 0.01 minimum, so a child that the resize
scaled below 0.01 came back too narrow: a 70px text with a left
constraint in a board turned 45 degrees and narrowed to 0.01 kept
40.83px. An axis-aligned parent skips this path, so the layout of an
unturned copy kept 70px while the sync of that copy, which resizes its
turned main, gave 40.83px.
The scale back now divides by the child's real edge lengths, and only a
collapsed child takes no scale.
Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
| :world | :baseline | :now | :mean | :ratio |
|------------------------------------+-----------+--------+---------+--------|
| deepest-edit-through-three-levels | 35.215 | 21.281 | 21.79 | 0.6 |
| edit-through-a-chain-of-dependents | 68.931 | 41.715 | 42.166 | 0.61 |
| library-update-into-copies | 83.083 | 50.352 | 52.632 | 0.61 |
| main-edit-among-many-shapes | 4.837 | 2.29 | 2.413 | 0.47 |
| main-edit-into-10-copies | 1.79 | 0.932 | 0.983 | 0.52 |
| main-edit-into-100-copies | 15.415 | 8.968 | 9.361 | 0.58 |
| main-edit-into-1000-copies | 153.086 | 99.524 | 107.384 | 0.65 |
| variant-switch-into-copies | 32.052 | 21.503 | 21.923 | 0.67 |
AI-assisted-by: claude-opus-5-5
A grid fills a child turned in it along the grid's axes, which skews the
child. In a column a fixed sibling left without width, the fill squeezed
the child down to a line: its axes became parallel and its transform
singular, and its stored rotation stopped describing it.
The fill no longer narrows a turned child below 1px of thickness in its
own axes; the child overflows its column instead. The grid passes each
child's own corners with its bounds in the grid's axes to know its size
and turn.
Benchmark (scripts/bench-components, ms, lower 2.5% quantile):
| world | baseline | now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels | 35.215 | 19.605 | 0.56 |
| edit-through-a-chain-of-dependents | 68.931 | 41.613 | 0.60 |
| library-update-into-copies | 83.083 | 47.375 | 0.57 |
| main-edit-among-many-shapes | 4.837 | 2.321 | 0.48 |
| main-edit-into-10-copies | 1.79 | 0.949 | 0.53 |
| main-edit-into-100-copies | 15.415 | 10.086 | 0.65 |
| main-edit-into-1000-copies | 153.086 | 92.412 | 0.60 |
| variant-switch-into-copies | 32.052 | 20.051 | 0.63 |
AI-assisted-by: claude-opus-5-5
A turned board that fills its flex parent skews, and so does a grid
board it holds. In the layout pass a layout board handed its modifiers
only to its absolute children, so the layout moved the others without
the board's turn or skew: they stayed rigid, while the WASM layout and a
component sync skew them. The layout pass now hands a layout board's
modifiers to all its children, which keep their size along its axes,
and the layout places them from the transformed bounds.
Benchmark (scripts/bench-components, lower quantile in ms):
| world | baseline | now | ratio |
|------------------------------------+----------+---------+-------|
| deepest-edit-through-three-levels | 35.215 | 20.425 | 0.58 |
| edit-through-a-chain-of-dependents | 68.931 | 41.077 | 0.60 |
| library-update-into-copies | 83.083 | 47.075 | 0.57 |
| main-edit-among-many-shapes | 4.837 | 2.276 | 0.47 |
| main-edit-into-10-copies | 1.79 | 0.998 | 0.56 |
| main-edit-into-100-copies | 15.415 | 11.243 | 0.73 |
| main-edit-into-1000-copies | 153.086 | 109.801 | 0.72 |
| variant-switch-into-copies | 32.052 | 20.218 | 0.63 |
AI-assisted-by: claude-opus-5-5
* 🐛 Fix nil deref on missing bounds in layout modifier propagation
When a parent shape has a child ID in its shapes vector that does
not exist in the objects map, the layout modifier code crashes
because it derefs nil from the bounds map.
The root cause is that children from the parent shapes list are
not validated against the objects map before being passed to the
layout modifier pipeline. Children with missing IDs pass through
unchecked and reach apply-modifiers where bounds lookup fails.
Fix by adding nil guards in apply-modifiers to skip children
without bounds, and changing map to keep to filter them out.
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
* 📎 Add tests for nil bounds in layout modifier propagation
Tests cover flex and grid layout scenarios where a parent
frame has child IDs in its shapes vector that do not exist
in the objects map, verifying that set-objects-modifiers
handles these gracefully without crashing.
Tests:
- Flex layout with normal children (baseline)
- Flex layout with non-existent child in shapes
- Flex layout with only non-existent children
- Grid layout with non-existent child in shapes
- Flex layout resize propagation with ghost children
- Nested flex layout with non-existent child in outer frame
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
---------
Signed-off-by: Andrey Antukh <niwi@niwi.nz>