summaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2019-12-17 19:12:31 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2019-12-17 19:12:31 +0100
commita81862884822d320790dfb3071384b89f9dc0a82 (patch)
tree12f115873f6e57b722bae7e0eb4d30bca4bdffab /core/src
parente4800bc967a9f320cd4704db0c061d9db562cb74 (diff)
downloadgdx-boardgame-a81862884822d320790dfb3071384b89f9dc0a82.zip
gdx-boardgame-a81862884822d320790dfb3071384b89f9dc0a82.tar.gz
Paddable : add getInnerTop() and getInnerRight()
Diffstat (limited to 'core/src')
-rw-r--r--core/src/ch/asynk/gdx/boardgame/Paddable.java2
-rw-r--r--core/src/ch/asynk/gdx/boardgame/ui/Element.java20
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()
{