From bf352104bd040992cbcc52a7d311cbbbe401718c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sat, 28 Dec 2019 13:42:47 +0100 Subject: ui : draw() code cleanup --- core/src/ch/asynk/gdx/boardgame/ui/List.java | 1 - core/src/ch/asynk/gdx/boardgame/ui/Root.java | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/ch/asynk/gdx/boardgame/ui/List.java b/core/src/ch/asynk/gdx/boardgame/ui/List.java index 3ed5985..3e050a6 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/List.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/List.java @@ -94,7 +94,6 @@ public class List extends Element @Override public void draw(Batch batch) { if (!visible) return; - if (tainted) computeGeometry(); float x = getInnerX(); float y = getInnerTop(); diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Root.java b/core/src/ch/asynk/gdx/boardgame/ui/Root.java index 96ea218..c84287b 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Root.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Root.java @@ -55,6 +55,7 @@ public class Root extends Element @Override public void draw(Batch batch) { + if (!visible) return; if (tainted) computeGeometry(); children.forEach( c -> c.draw(batch) ); } -- cgit v1.1-2-g2b99