Skip to content

Conversation

cypherdare
Copy link
Member

I removed a couple of redundant lines (I'll explain below) and added an optimization when setting a new region.

Resolves #3722 by correcting the docs for the getColor methods. I didn't simply say "don't modify the returned color" because it would be valid to pass the color back into setColor, which might be convenient if doing some sort of transformation on the existing color.

@@ -37,7 +37,6 @@

public PolygonSprite (PolygonRegion region) {
setRegion(region);
setColor(1, 1, 1, 1);
Copy link
Member Author

@cypherdare cypherdare Jan 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed for being redundant. setRegion() always applies the color.

@@ -62,7 +61,6 @@ public void set (PolygonSprite sprite) {
scaleX = sprite.scaleX;
scaleY = sprite.scaleY;
color.set(sprite.color);
dirty = sprite.dirty;
Copy link
Member Author

@cypherdare cypherdare Jan 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was a bug. The complete vertex data array is not copied from the other sprite, so this sprite is always dirty at this point.

@Tom-Ski Tom-Ski merged commit cadde1a into libgdx:master Jan 25, 2017
@cypherdare cypherdare deleted the pgSprite2 branch January 25, 2017 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants