Commit 6b192c8
fix(themes): re-measure nodes on level change and theme swap
The new Whimsy theme (6682cb2) exposed a latent node-sizing bug.
NodeItem measured itself on ItemSceneHasChanged, but
MindMapScene::addNode (and AddNodeCommand::redo) set the parent
*after* addItem — so level() was 0 at measurement time and every
node briefly got sized with rootStyle. With themes whose rootStyle
barely differs from nodeStyle (default, tinted, ...) the effect was
invisible, but Whimsy's Georgia 22pt rootStyle made every child take
on root dimensions, producing oversized rectangles.
- setParentNode now re-measures on level change, so the existing
addItem-then-addChild order produces correct sizes.
- setThemeId re-measures every node (new public refreshGeometry)
and refreshes edges, so a theme swap picks up padding/font/min-max
width changes instead of keeping the previous theme's dimensions.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 6682cb2 commit 6b192c8
3 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
183 | 185 | | |
184 | 186 | | |
185 | 187 | | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
| 192 | + | |
| 193 | + | |
188 | 194 | | |
189 | 195 | | |
190 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
511 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
512 | 518 | | |
513 | 519 | | |
514 | 520 | | |
| |||
600 | 606 | | |
601 | 607 | | |
602 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
603 | 613 | | |
604 | 614 | | |
605 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
0 commit comments