collin/mahjong · 08bf9a7c
The tuner's sliders reach the wall again
Collin Richards · 2026-08-21 21:23 UTC · 08bf9a7c3317466cf545719d3c9e27a8f4dafad3 · parent b9eed9cc · browse files
modifiedsrc/ui/WallRing.tsx+11 −1
| ⋯ 155 unchanged lines | |||
| 156 | 156 | const observer = new ResizeObserver(read); | |
| 157 | 157 | observer.observe(middle); | |
| 158 | 158 | observer.observe(probe); | |
| 159 | - | return () => observer.disconnect(); | |
| 159 | + | // The shape is three numbers on the element — the corner it turns, how far | |
| 160 | + | // round it is set, how far the walls lap — and changing any of them changes | |
| 161 | + | // nothing that has a size, so neither of the observers above would ever | |
| 162 | + | // hear about it. `/wall.html` sets them on the ring itself, so that is what | |
| 163 | + | // is watched. | |
| 164 | + | const styled = new MutationObserver(read); | |
| 165 | + | styled.observe(el, { attributes: true, attributeFilter: ['style', 'class'] }); | |
| 166 | + | return () => { | |
| 167 | + | observer.disconnect(); | |
| 168 | + | styled.disconnect(); | |
| 169 | + | }; | |
| 160 | 170 | }, [ring]); | |
| 161 | 171 | ||
| 162 | 172 | return square; | |
| ⋯ 1 unchanged line | |||