aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-01-31 11:56:36 +0100
committerSven Göthel <[email protected]>2024-01-31 11:56:36 +0100
commit5cf0d370dbc2b1f59102522d40f4875f7d77b1f7 (patch)
tree369a7cff074f9d654e046722d912e5226c7311aa /src/graphui
parentf7458c47338c90db19ef3f0143a268b60b1267a3 (diff)
GraphUI: Only issue Shape.mark*Dirty() if values were updated or data available; JOGL ImageSequence: Add addFrame(GL, TextureFrame), remove*Frame() and isSequenceAnimating()
Diffstat (limited to 'src/graphui')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/BaseButton.java8
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java4
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java10
3 files changed, 14 insertions, 8 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/BaseButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/BaseButton.java
index 83835a913..45ebbe58c 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/BaseButton.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/BaseButton.java
@@ -115,9 +115,11 @@ public class BaseButton extends GraphShape {
}
public BaseButton setSize(final float width, final float height) {
- this.width = width;
- this.height = height;
- markShapeDirty();
+ if( this.width != width || this.height != height ) {
+ this.width = width;
+ this.height = height;
+ markShapeDirty();
+ }
return this;
}
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java
index a6c5bda34..2cb21e268 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/ImageButton.java
@@ -61,6 +61,8 @@ public class ImageButton extends TexSeqButton {
setToggleOnColorMod(0.8f, 0.8f, 0.8f, 1f);
}
+ public ImageSequence getImageSequence() { return (ImageSequence)texSeq; }
+
public final void setCurrentIdx(final int idx) {
((ImageSequence)texSeq).setCurrentIdx(idx);
markStateDirty();
@@ -69,7 +71,7 @@ public class ImageButton extends TexSeqButton {
@Override
public void draw(final GL2ES2 gl, final RegionRenderer renderer) {
super.draw(gl, renderer);
- if( !((ImageSequence)texSeq).getManualStepping() ) {
+ if( ((ImageSequence)texSeq).isSequenceAnimating() ) {
markStateDirty(); // keep on going
}
};
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java
index ae2af3960..b90c7670a 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java
@@ -122,10 +122,12 @@ public class Rectangle extends GraphShape {
markShapeDirty();
}
public void setDimension(final float width, final float height, final float lineWidth) {
- this.width = width;
- this.height = height;
- this.lineWidth = lineWidth;
- markShapeDirty();
+ if( this.width != width || this.height != height || this.lineWidth != lineWidth ) {
+ this.width = width;
+ this.height = height;
+ this.lineWidth = lineWidth;
+ markShapeDirty();
+ }
}
public void setBounds(final AABBox abox, final float lineWidth) {
setPosition(abox.getMinX(), abox.getMinY(), abox.getCenter().z());