flame-engine / flame-engine/flame

Link paint and paintLayers in HasPaint mixin

Open
#2,276 4 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.