OSDN Git Service

Fixed texture region x/y rounding problem.
[mikumikustudio/libgdx-mikumikustudio.git] / gdx / src / com / badlogic / gdx / graphics / g2d / TextureRegion.java
index b307f92..9ce40b8 100644 (file)
@@ -152,7 +152,7 @@ public class TextureRegion {
        }\r
 \r
        public int getRegionX () {\r
-               return (int)(u * texture.getWidth());\r
+               return Math.round(u * texture.getWidth());\r
        }\r
 \r
        public void setRegionX (int x) {\r
@@ -160,7 +160,7 @@ public class TextureRegion {
        }\r
 \r
        public int getRegionY () {\r
-               return (int)(v * texture.getHeight());\r
+               return Math.round(v * texture.getHeight());\r
        }\r
 \r
        public void setRegionY (int y) {\r