OSDN Git Service

Fixed bug with scrolling Sprite textures.
authornathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Thu, 21 Oct 2010 20:11:46 +0000 (20:11 +0000)
committernathan.sweet <nathan.sweet@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Thu, 21 Oct 2010 20:11:46 +0000 (20:11 +0000)
gdx/src/com/badlogic/gdx/graphics/Sprite.java

index 6938ab8..ef4409f 100644 (file)
@@ -181,7 +181,7 @@ public class Sprite {
         */\r
        public void scrollTexture (float xAmount, float yAmount) {\r
                float[] vertices = this.vertices;\r
-               if (xAmount > 0) {\r
+               if (xAmount != 0) {\r
                        float u = (vertices[U1] + xAmount) % 1;\r
                        float u2 = u + width / texture.getWidth();\r
                        vertices[U1] = u;\r
@@ -189,7 +189,7 @@ public class Sprite {
                        vertices[U3] = u2;\r
                        vertices[U4] = u2;\r
                }\r
-               if (yAmount > 0) {\r
+               if (yAmount != 0) {\r
                        float v = (vertices[V1] + yAmount) % 1;\r
                        float v2 = v + height / texture.getHeight();\r
                        vertices[V1] = v;\r