Commit Graph
1650 Commits
Author SHA1 Message Date
Trevor BrownandClaude Sonnet 5.5 e276b1e4ff M10: SwiftUI, Compose and Flutter code export writes every colour and gradient fill, in paint order (#2271)
Part of #2271. The native targets took ONE colour from a layer (`first_fill`: the bottom visible solid, or a gradient's first stop) and dropped every other fill, so a frame with white, a gradient and 50% black came out as flat white.

Now SwiftUI, Compose and Flutter write every visible solid and gradient fill of a frame, group, rectangle or ellipse, in paint order, and a gradient as a gradient. A shared `visible_fills` gives each target the same list (document order, bottom first); each target only formats it.

- SwiftUI: chained `.background(...)`, top fill first, since each one goes behind the ones before it. A rectangle or ellipse fills with the bottom paint and lays a copy of the shape over it (`.overlay`) for each paint above, bottom first.
- Compose: chained `Modifier.background(...)`, bottom fill first, since each one draws over the ones before it. A linear gradient snaps to one of eight directions (a modifier doesn't know pixels); radial and angular ones sit at the box's centre.
- Flutter: a `BoxDecoration` paints one colour or gradient, so the Container keeps the top fill and each fill under it becomes a `DecoratedBox` around the widget, the bottom fill outermost. The drop shadow goes on the outermost box so it never lies over a lower fill. An instance's call is now made once, in `flutter_placed`.

A layer with one solid fill gives the same code as before, variable names included (only the paint at index 0, when solid, takes the `fill` variable's name). A lone gradient used to come out as its first stop's colour and is now a gradient.

Still not written: image and pattern fills in the native targets, ArkUI (one background and one gradient per component, so a stack needs extra nodes) and text with several fills. Figma's iOS and Android output was not measured: the order follows how each platform paints.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.2 briefed; Sonnet 5.5 wrote at medium
2026-11-12 17:04:23 -05:00
bflatastic 5b20fac623 Merge main into #2163 2026-11-12 14:22:18 +07:00
bflatastic 64e3684a11 Merge main into #2163 2026-11-12 14:05:23 +07:00
bflatastic 12b293efe5 Merge main into #2200 2026-11-12 14:04:50 +07:00
bflatastic 47f5518155 Merge main into #2163 2026-11-12 13:49:58 +07:00
bflatastic 7a052d73a4 Merge main into #2192 2026-11-12 13:49:25 +07:00
bflatastic d3f14f5bd8 Merge main into #2200 2026-11-12 13:48:51 +07:00
bflatastic b9486affb9 Merge main into #2163 2026-11-12 13:30:33 +07:00
bflatastic d50203228d Merge main into #2191 2026-11-12 13:29:57 +07:00
bflatastic 2636516fbb Merge main into #2192 2026-11-12 13:29:23 +07:00
bflatastic c98ad17451 Merge main into #2200 2026-11-12 13:28:50 +07:00
bflatastic d3a75187d8 Merge main into #2163 2026-11-12 13:15:51 +07:00
bflatastic 7f017a736b Merge main into #2191 2026-11-12 13:15:16 +07:00
bflatastic 23db6dbddb Merge main into #2192 2026-11-12 13:14:43 +07:00
bflatastic bd656ae5b3 Merge main into #2199 2026-11-12 13:14:10 +07:00
bflatastic 39b7c54766 Merge main into #2200 2026-11-12 13:13:38 +07:00
bflatastic 41a8915c4e Merge main into #2163 2026-11-12 12:58:57 +07:00
bflatastic f286b6bbe6 Merge main into #2191 2026-11-12 12:58:24 +07:00
bflatastic d656417b02 Merge main into #2192 2026-11-12 12:57:51 +07:00
bflatastic cee3462e40 Merge main into #2199 2026-11-12 12:57:19 +07:00
bflatastic 0bfb944d4d Merge main into #2200 2026-11-12 12:56:45 +07:00
bflatastic b6b9b2995f Merge main into #2224 2026-11-12 12:56:12 +07:00
bflatastic 632056130d Merge main into #2163 2026-11-12 12:42:58 +07:00
bflatastic 28b46bb334 Merge main into #2191 2026-11-12 12:42:24 +07:00
bflatastic 007f495e89 Merge main into #2192 2026-11-12 12:41:50 +07:00
bflatastic cf339eba02 Merge main into #2199 2026-11-12 12:41:15 +07:00
bflatastic 50d2d63090 Merge main into #2200 2026-11-12 12:40:43 +07:00
bflatastic 77fcc564a3 Merge main into #2224 2026-11-12 12:40:10 +07:00
bflatastic 997e022ecf Merge main into #2121 2026-11-12 12:39:36 +07:00
bflatastic 73e1339b14 Merge main into #2163 2026-11-12 12:27:20 +07:00
bflatastic 79248ede26 Merge main into #2191 2026-11-12 12:26:47 +07:00
bflatastic 80f4f36290 Merge main into #2192 2026-11-12 12:26:15 +07:00
bflatastic c7589dac3e Merge main into #2199 2026-11-12 12:25:42 +07:00
bflatastic 8cb527bd21 Merge main into #2200 2026-11-12 12:25:09 +07:00
bflatastic 5549c4cc2e Merge main into #2224 2026-11-12 12:24:36 +07:00
bflatastic 7f0e94508d Merge main into #2121 2026-11-12 12:23:30 +07:00
bflatastic a6f98591d3 Merge main into #2147 2026-11-12 12:22:57 +07:00
bflatastic e259dffebd Merge main into #2163 2026-11-12 12:11:40 +07:00
bflatastic 0ed464c91a Merge main into #2191 2026-11-12 12:11:07 +07:00
bflatastic 405c0939ca Merge main into #2192 2026-11-12 12:10:34 +07:00
bflatastic b16a345386 Merge main into #2199 2026-11-12 12:10:01 +07:00
bflatastic 8e04a4ab10 Merge main into #2200 2026-11-12 12:09:15 +07:00
bflatastic 04c7856d1b Merge main into #2224 2026-11-12 12:08:42 +07:00
bflatastic 05c666add5 Merge main into #2096 2026-11-12 12:07:36 +07:00
bflatastic 2d5729e7ee Merge main into #2121 2026-11-12 12:06:52 +07:00
bflatastic b742d7464b Merge main into #2147 2026-11-12 12:05:53 +07:00
BFlat f2135dda4f Merge pull request #2244 from TrevorBrown-dev/fix/flatten-bakes-point-radius-2195
M4: Flatten bakes a vector's point corner radius into its path (#2195)
2026-11-12 12:03:15 +07:00
BFlat 3e9a694dc7 Merge pull request #2103 from TrevorBrown-dev/fix/panel-widths-measured
Panels: the sidebars' width limits are Figma's (left 240 to 450, right 240 to 500)
2026-11-12 11:55:44 +07:00
bflatastic 51093c89ee Merge main into #2163 2026-11-12 11:55:03 +07:00
bflatastic f9a4358c67 Merge main into #2191 2026-11-12 11:54:30 +07:00