From a81862884822d320790dfb3071384b89f9dc0a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 17 Dec 2019 19:12:31 +0100 Subject: Paddable : add getInnerTop() and getInnerRight() --- core/src/ch/asynk/gdx/boardgame/Paddable.java | 2 ++ core/src/ch/asynk/gdx/boardgame/ui/Element.java | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/core/src/ch/asynk/gdx/boardgame/Paddable.java b/core/src/ch/asynk/gdx/boardgame/Paddable.java index 988d344..837ad92 100644 --- a/core/src/ch/asynk/gdx/boardgame/Paddable.java +++ b/core/src/ch/asynk/gdx/boardgame/Paddable.java @@ -6,6 +6,8 @@ public interface Paddable public float getInnerY(); public float getInnerWidth(); public float getInnerHeight(); + public float getInnerTop(); + public float getInnerRight(); public void setPadding(float padding); public void setPosition(float x, float y, float w, float h); } diff --git a/core/src/ch/asynk/gdx/boardgame/ui/Element.java b/core/src/ch/asynk/gdx/boardgame/ui/Element.java index 6c10841..3368f3c 100644 --- a/core/src/ch/asynk/gdx/boardgame/ui/Element.java +++ b/core/src/ch/asynk/gdx/boardgame/ui/Element.java @@ -38,15 +38,17 @@ public abstract class Element implements Drawable, Paddable, Positionable, Touch this.taintParent = taintParent; } - @Override public final float getX() { return rect.x; } - @Override public final float getY() { return rect.y; } - @Override public final float getWidth() { return rect.width; } - @Override public final float getHeight() { return rect.height; } - - @Override public final float getInnerX() { return rect.x + padding; } - @Override public final float getInnerY() { return rect.y + padding; } - @Override public final float getInnerWidth() { return rect.width - 2 * padding; } - @Override public final float getInnerHeight() { return rect.height - 2 * padding; } + @Override public final float getX() { return rect.x; } + @Override public final float getY() { return rect.y; } + @Override public final float getWidth() { return rect.width; } + @Override public final float getHeight() { return rect.height; } + + @Override public final float getInnerX() { return rect.x + padding; } + @Override public final float getInnerY() { return rect.y + padding; } + @Override public final float getInnerWidth() { return rect.width - 2 * padding; } + @Override public final float getInnerHeight() { return rect.height - 2 * padding; } + @Override public final float getInnerTop() { return rect.y + rect.height - padding; } + @Override public final float getInnerRight() { return rect.x + rect.width - padding; } @Override public String toString() { -- cgit v1.1-2-g2b99