Commit b8d9051
feat(compositor): text color, font selection, draggable layers, clipping fix (#80)
* feat(compositor): text color, font selection, draggable layers, clipping fix
- Text color: add color picker (RGB + alpha slider) for text overlays
- Font selection: add font_name field to TextOverlayConfig with 12
curated system fonts (DejaVu, Liberation, FreeFonts), dropdown in UI,
warning when named font file is missing
- Draggable layer list: replace z-index ▲/▼ buttons with drag-to-reorder
using motion/react Reorder, reassigns z-indices on drop
- Text clipping fix: expand bitmap height to ceil(font_size * 1.4) in
rasterize_text_overlay and auto-expand UI rect height when font size
increases
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* style: apply rustfmt to overlay.rs
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* fix: batch reorder z-index updates and add color comparison
- Add reorderLayers() to useCompositorLayers that atomically updates
z-index for all layer types (video, text, image) in a single commit,
preventing race conditions from stale refs when handleReorder fired
N individual update calls.
- Add missing color array comparison to mergeOverlayState's
hasExtraChanges comparator so server-echoed color changes are
correctly detected.
- Remove unused onZIndexChange prop from UnifiedLayerList since
reorderLayers now handles all z-index mutations.
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* fix: use dynamic max z-index for new overlays instead of fixed bands
Replace fixed z-index bands (text: 100+, image: 200+) with
maxZIndex() + 1 so that new overlays always stack on top even after
drag-to-reorder has normalized z-indices to [0, n-1].
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* fix: expand text overlay bitmap to measured text dimensions
Add measure_text() that computes actual pixel width/height from font
metrics, and use it in rasterize_text_overlay to expand the bitmap to
fit the full rendered string. Previously only height was expanded via a
1.4× heuristic; now both width and height use exact font measurements.
On the UI side, updateTextOverlay now auto-expands the rect width
(~0.6× font_size per character) in addition to height when the text
would overflow the current box.
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* style: cargo fmt
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* fix: address review — atomic reorder commit and complete font list
- Replace throttledConfigChange with immediate onParamChange in
reorderLayers' onParamChange path so video layer and overlay z-index
updates commit atomically in the same tick.
- Extract serializeLayers() helper to avoid duplicating layer
serialization logic between buildConfig and reorderLayers.
- Add missing dejavu-serif-bold and dejavu-sans-mono-bold to the
font_name doc comment in TextOverlayConfig.
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* feat: render font selection in canvas preview and fix dropdown contrast
- Add FONT_FAMILY_MAP to CompositorCanvas that maps backend font names
to CSS font-family values. Text overlays now preview the selected font
in both display and edit mode on the canvas.
- Bold font variants (e.g. dejavu-sans-bold) render with fontWeight 700.
- Fix FontSelect contrast: use var(--sk-panel-bg) instead of undefined
var(--sk-input-bg), add color-scheme hint, and style option elements
explicitly for dark mode compatibility.
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* fix: improve font preview fallbacks and remove alpha slider
- Add web-safe intermediate fonts (Verdana, Georgia, Arial, Times New
Roman, Courier New) to the CSS font-family fallback stacks so the
canvas preview shows a visible difference between sans-serif, serif,
and monospace font groups even when the exact system fonts are not
installed in the browser.
- Remove the alpha slider from text color controls. Text opacity is
already covered by the layer opacity slider, and a standalone alpha
slider for a single channel was confusing. The color picker now
always sends alpha=255.
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
* fix: preserve existing alpha when changing text color
Signed-off-by: Devin AI <devin@devin.ai>
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
---------
Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Signed-off-by: Devin AI <devin@devin.ai>
Co-authored-by: StreamKit Devin <devin@streamkit.dev>
Co-authored-by: Claudio Costa <cstcld91@gmail.com>1 parent f2ba317 commit b8d9051
File tree
7 files changed
+501
-179
lines changed- crates/nodes/src/video
- compositor
- ui/src
- components
- hooks
- nodes
7 files changed
+501
-179
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| 1109 | + | |
1109 | 1110 | | |
1110 | 1111 | | |
1111 | | - | |
1112 | | - | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1113 | 1118 | | |
1114 | 1119 | | |
1115 | 1120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
130 | 149 | | |
131 | 150 | | |
132 | | - | |
133 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
134 | 154 | | |
135 | 155 | | |
136 | 156 | | |
137 | 157 | | |
138 | 158 | | |
139 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
140 | 171 | | |
141 | 172 | | |
142 | 173 | | |
| |||
148 | 179 | | |
149 | 180 | | |
150 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
151 | 187 | | |
152 | 188 | | |
153 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
154 | 193 | | |
155 | 194 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 195 | | |
160 | 196 | | |
161 | 197 | | |
| |||
165 | 201 | | |
166 | 202 | | |
167 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
168 | 222 | | |
169 | 223 | | |
170 | 224 | | |
| |||
209 | 263 | | |
210 | 264 | | |
211 | 265 | | |
212 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
213 | 274 | | |
214 | 275 | | |
215 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
45 | 91 | | |
46 | 92 | | |
47 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
37 | 66 | | |
38 | 67 | | |
39 | 68 | | |
| |||
356 | 385 | | |
357 | 386 | | |
358 | 387 | | |
359 | | - | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
360 | 392 | | |
361 | 393 | | |
362 | 394 | | |
363 | 395 | | |
364 | 396 | | |
365 | 397 | | |
366 | 398 | | |
367 | | - | |
| 399 | + | |
| 400 | + | |
368 | 401 | | |
369 | 402 | | |
370 | 403 | | |
| |||
0 commit comments