diff options
author | Sven Gothel <[email protected]> | 2023-04-28 14:54:57 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-04-28 14:54:57 +0200 |
commit | db139c97e193b0df385867615bd7a61ee9e5f3a4 (patch) | |
tree | 15473abc44e77c1ff1728405e5757e13df78fc07 /src/graphui/classes/com/jogamp | |
parent | a7afdc0530fd5c8e2f24d9be58db4c8b8e11e368 (diff) |
GraphUI Shape: Fix hasPadding() and add padding + border details to toString()
Diffstat (limited to 'src/graphui/classes/com/jogamp')
-rw-r--r-- | src/graphui/classes/com/jogamp/graph/ui/Shape.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/Shape.java b/src/graphui/classes/com/jogamp/graph/ui/Shape.java index faa14b298..4884e6d6d 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/Shape.java +++ b/src/graphui/classes/com/jogamp/graph/ui/Shape.java @@ -197,7 +197,7 @@ public abstract class Shape { public Padding getPadding() { return padding; } /** Returns true if {@link #setPaddding(Padding)} added a non {@link Padding#zeroSumSize()} spacing to this shape. */ - public boolean hasPadding() { null != padding && !padding.zeroSumSize(); } + public boolean hasPadding() { return null != padding && !padding.zeroSumSize(); } /** * Sets the thickness of the border, which is included in {@link #getBounds()} and is outside of {@link #getPadding()}. Default is zero for no border. @@ -908,10 +908,12 @@ public abstract class Shape { } else { rotateS = ""; } + final String ps = hasPadding() ? padding.toString()+", " : "Padding 0, "; + final String bs = hasBorder() ? "Border "+getBorderThickness()+", " : "Border 0, "; return "enabled "+enabled+", toggle[able "+toggleable+", state "+toggle+ "], able[iactive "+isInteractive()+", resize "+isResizable()+", move "+this.isDraggable()+ "], pos["+position+"], "+pivotS+scaleS+rotateS+ - "box"+box; + ps+bs+"box"+box; } // |