OSDN Git Service

ScissorStack, proper rounding in all cases (sweet baby jesus).
authorNathanSweet <nathan.sweet@gmail.com>
Sat, 29 Sep 2012 04:03:24 +0000 (21:03 -0700)
committerNathanSweet <nathan.sweet@gmail.com>
Sat, 29 Sep 2012 04:03:24 +0000 (21:03 -0700)
gdx/src/com/badlogic/gdx/scenes/scene2d/utils/ScissorStack.java

index a00cbd4..11f0213 100644 (file)
@@ -64,7 +64,7 @@ public class ScissorStack {
                        scissor.height = Math.max(1, maxY - minY);\r
                }\r
                scissors.add(scissor);\r
-               Gdx.gl.glScissor(Math.round(scissor.x), Math.round(scissor.y), Math.round(scissor.width), Math.round(scissor.height));\r
+               Gdx.gl.glScissor((int)scissor.x, (int)scissor.y, (int)scissor.width, (int)scissor.height);\r
                return true;\r
        }\r
 \r
@@ -81,6 +81,10 @@ public class ScissorStack {
        }\r
 \r
        private static void fix (Rectangle rect) {\r
+               rect.x = Math.round(rect.x);\r
+               rect.y = Math.round(rect.y);\r
+               rect.width = Math.round(rect.width);\r
+               rect.height = Math.round(rect.height);\r
                if (rect.width < 0) {\r
                        rect.width = -rect.width;\r
                        rect.x -= rect.width;\r