OSDN Git Service

Fixed stage clipping when using glViewport. Fixed clicking outside of stage.
[mikumikustudio/libgdx-mikumikustudio.git] / gdx / src / com / badlogic / gdx / scenes / scene2d / Actor.java
index 7243870..83d02f4 100644 (file)
@@ -82,13 +82,12 @@ public class Actor {
         * The default implementation calls {@link Action#act(float)} on each action and removes actions that are complete.\r
         * @param delta Time in seconds since the last frame. */\r
        public void act (float delta) {\r
-               for (int i = 0, n = actions.size; i < n; i++) {\r
+               for (int i = 0; i < actions.size; i++) {\r
                        Action action = actions.get(i);\r
-                       if (action.act(delta)) {\r
+                       if (action.act(delta) && i < actions.size) {\r
                                actions.removeIndex(i);\r
                                action.setActor(null);\r
                                i--;\r
-                               n--;\r
                        }\r
                }\r
        }\r
@@ -566,7 +565,7 @@ public class Actor {
                tableBounds.height = height;\r
                Stage stage = this.stage;\r
                Rectangle scissorBounds = Pools.obtain(Rectangle.class);\r
-               ScissorStack.calculateScissors(stage.getCamera(), stage.getSpriteBatch().getTransformMatrix(), tableBounds, scissorBounds);\r
+               stage.calculateScissors(tableBounds, scissorBounds);\r
                if (ScissorStack.pushScissors(scissorBounds)) return true;\r
                Pools.free(scissorBounds);\r
                return false;\r