Skip to content

Commit

Permalink
Handle of/-0f special case
Browse files Browse the repository at this point in the history
  • Loading branch information
obigu committed Sep 13, 2023
1 parent 3c35960 commit 90752d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gdx/src/com/badlogic/gdx/graphics/g2d/Sprite.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ public void setColor (float r, float g, float b, float a) {
* @see #setColor(Color)
* @see Color#toFloatBits() */
public void setPackedColor (float packedColor) {
if (this.packedColor != packedColor) {
// Handle 0f/-0f special case
if (packedColor != this.packedColor || (packedColor == 0f && this.packedColor == 0f && Float.floatToIntBits(packedColor) != Float.floatToIntBits(this.packedColor))) {
this.packedColor = packedColor;
Color.abgr8888ToColor(color, packedColor);
float[] vertices = this.vertices;
Expand Down

0 comments on commit 90752d4

Please sign in to comment.