flame-engine / flame-engine/flame
Link paint and paintLayers in HasPaint mixin
- Dominant language
- Dart
- Stars
- 10.8k
- Forks
- 1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 21
Description
# What could be improved
In the `HasPaint` mixin, `paint` and `paintLayers` are mutually exclusive. When `paintLayers` contains paints, `paint` is ignored when rendering. Similarly, paints in `paintLayer` have no effect on the component's primary `paint`.
`paint` should be considered the first layer in `paintLayers`. Similarly get and set of `paint` should point to the first element of `paintLayers`.
# Why should this be improved
It could be confusing to have the component's `paint` value be ignored after setting layers. `paintLayers` should not be empty if get, it should contain the current `paint` as this is a layer being painted. Adding a new paint layer should add onto the current `paint`, not override it.
# Any risks?
No change to the API. No additional memory.
# More information
I can submit a PR if the above is agreed. Only minor code changes required.
Contributor guide
Assessment
This issue has not been assessed yet.