OSDN Git Service

Fixed issue 958, sprite broken.
[mikumikustudio/libgdx-mikumikustudio.git] / gdx / src / com / badlogic / gdx / graphics / g2d / TextureRegion.java
index f35e7b5..3424987 100644 (file)
@@ -81,10 +81,7 @@ public class TextureRegion {
        public void setRegion (int x, int y, int width, int height) {\r
                float invTexWidth = 1f / texture.getWidth();\r
                float invTexHeight = 1f / texture.getHeight();\r
-               this.u = x * invTexWidth;\r
-               this.v = y * invTexHeight;\r
-               this.u2 = (x + width) * invTexWidth;\r
-               this.v2 = (y + height) * invTexHeight;\r
+               setRegion(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight);\r
                regionWidth = Math.abs(width);\r
                regionHeight = Math.abs(height);\r
        }\r