Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicitly clone a Color when setting it #840

Closed
jedeen opened this issue Jun 13, 2017 · 0 comments
Closed

Implicitly clone a Color when setting it #840

jedeen opened this issue Jun 13, 2017 · 0 comments
Labels
enhancement Label applied to enhancements or improvements to existing features good first issue good for people new to open source and Excalibur

Comments

@jedeen
Copy link
Member

jedeen commented Jun 13, 2017

Context

When setting an ex.Color on an Actor, Excalibur does not implicitly clone the Color. This currently has the potential to cause confusion if multiple Actors are set to the same color, and then graphics transformations are applied that affect that Color (for example, changing the alpha channel value).

(see also #797)

Proposal

Clone ex.Color when it is set, to avoid potentially unintended effects across multiple Actors.

@jedeen jedeen added the enhancement Label applied to enhancements or improvements to existing features label Jun 13, 2017
@jedeen jedeen modified the milestone: vNext Aug 13, 2017
@eonarheim eonarheim added the good first issue good for people new to open source and Excalibur label Sep 12, 2017
Nysosis pushed a commit to Nysosis/Excalibur that referenced this issue Sep 12, 2017
## Changes:

- Color is now a property with getter and setter, with the setter cloning the original value

Resolves excaliburjs#840
@jedeen jedeen modified the milestones: 0.13.0 Release, vNext Sep 12, 2017
eonarheim pushed a commit that referenced this issue Sep 14, 2017
Closes #840 

## Changes:

- Made `color` on `Actor` have a getter/setter, which implicitly clones the color value when set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Label applied to enhancements or improvements to existing features good first issue good for people new to open source and Excalibur
Projects
None yet
Development

No branches or pull requests

2 participants