Closed iamralpht closed 2 weeks ago
The API to DCF conversion code is here: https://github.com/google/automotive-design-compose/blob/0552d72a4970346782f7766f9dd7d4dab3b6790d/crates/figma_import/src/transform_flexbox.rs#L592
The Kotlin code that creates a brush from the color stops is here https://github.com/google/automotive-design-compose/blob/0552d72a4970346782f7766f9dd7d4dab3b6790d/designcompose/src/main/java/com/android/designcompose/Utils.kt#L1234
Probably wise to do the same check for the other gradient types, too, and log & return Background::None
in Rust, and log & return null
in the Kotlin shader brush util.
Via @Heneveld, a recent regression in the Figma API, causes a crash in DesignCompose:
We should not crash in this case. Either we validate that there are at least two stops in the Figma API to DCF conversion (and log if not, discarding the fill), OR we do it in Kotlin (e.g.
ShaderBrush.applyTo
), OR both.