Commit 27d9beb
authored
ENG-831 - Refactor tldraw maximize to stop canvas jumping around (#423)
* Refactor Tldraw component to handle maximization state and viewport updates
- Introduced `handleMaximizedChange` to manage fullscreen toggling and DOM manipulation.
- Added `updateViewportScreenBounds` for viewport updates using Tldraw's built-in methods.
- Updated styles to support maximized state in Tldraw canvas.
- Removed unnecessary `maximized` state from props in `createUiOverrides`.
* - Renamed `setMaximized` to `toggleMaximized` for clarity in both Tldraw and uiOverrides components.
* Optimize viewport updates in Tldraw component by wrapping DOM measurements in requestAnimationFrame for smoother performance.1 parent 486be1b commit 27d9beb
File tree
3 files changed
+45
-15
lines changed- apps/roam/src/components/canvas
3 files changed
+45
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
132 | | - | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
135 | 166 | | |
136 | 167 | | |
137 | 168 | | |
| |||
390 | 421 | | |
391 | 422 | | |
392 | 423 | | |
393 | | - | |
394 | | - | |
| 424 | + | |
395 | 425 | | |
396 | 426 | | |
397 | 427 | | |
| |||
528 | 558 | | |
529 | 559 | | |
530 | 560 | | |
531 | | - | |
| 561 | + | |
532 | 562 | | |
533 | 563 | | |
534 | 564 | | |
535 | 565 | | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | 566 | | |
542 | 567 | | |
543 | 568 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
79 | 86 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
| 320 | + | |
322 | 321 | | |
323 | 322 | | |
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
328 | | - | |
329 | | - | |
| 327 | + | |
330 | 328 | | |
331 | 329 | | |
332 | 330 | | |
| |||
423 | 421 | | |
424 | 422 | | |
425 | 423 | | |
426 | | - | |
| 424 | + | |
427 | 425 | | |
428 | 426 | | |
429 | 427 | | |
| |||
0 commit comments