diff options
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java | 10 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java index 45ed14f7b..784fe1009 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java @@ -309,16 +309,12 @@ public class GPUUISceneGLListener0A implements GLEventListener { int sampleCount = sceneUIController.getSampleCount(); if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) { // left-half pressed - if( sampleCount > 0 ) { - sampleCount-=1; - } + sampleCount--; } else { // right-half pressed - if( sampleCount < 8 ) { - sampleCount+=1; - } + sampleCount++; } - sceneUIController.setSampleCount(sampleCount); + sampleCount = sceneUIController.setSampleCount(sampleCount); // validated / clipped } } } ); button.addMouseListener(dragZoomRotateListener); diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java index 008d4e038..3d4865b5d 100644 --- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java +++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java @@ -99,7 +99,11 @@ public class SceneUIController implements GLEventListener{ } public int getSampleCount() { return sampleCount[0]; } - public void setSampleCount(final int v) { sampleCount[0]=v; markAllShapesDirty(); } + public int setSampleCount(final int v) { + sampleCount[0] = Math.min(8, Math.max(v, 1)); // clip + markAllShapesDirty(); + return sampleCount[0]; + } public void setAllShapesQuality(final int q) { for(int i=0; i<shapes.size(); i++) { |