aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-12-19 17:35:31 +0100
committerSven Gothel <[email protected]>2023-12-19 17:35:31 +0100
commiteb99bfc27f9f49387cbb08471debcd4d61e4f745 (patch)
tree95937b8381d5898b53442927b94fb70492922c88 /src/graphui/classes/com
parent0944e120702c8bbaa562b817d387651addb11b86 (diff)
GraphUI Shape Rectangle: Draw simple filled rect if lineWidth==0, drop AA_RENDERING_MASK from renderModes (not necessary for a rect)
Diffstat (limited to 'src/graphui/classes/com')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java15
1 files changed, 8 insertions, 7 deletions
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 02ecd406c..593ba034d 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Rectangle.java
@@ -32,6 +32,7 @@ import com.jogamp.graph.curve.Region;
import com.jogamp.graph.curve.opengl.GLRegion;
import com.jogamp.graph.ui.GraphShape;
import com.jogamp.graph.ui.Shape;
+import com.jogamp.math.FloatUtil;
import com.jogamp.math.geom.AABBox;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.opengl.GLProfile;
@@ -57,11 +58,11 @@ public class Rectangle extends GraphShape {
* @param minY
* @param width
* @param height
- * @param lineWidth
+ * @param lineWidth line thickness, use zero for filled rectangle
* @param zPos
*/
public Rectangle(final int renderModes, final float minX, final float minY, final float width, final float height, final float lineWidth, final float zPos) {
- super(renderModes);
+ super( renderModes & ~Region.AA_RENDERING_MASK );
this.minX = minX;
this.minY = minY;
this.zPos = zPos;
@@ -75,7 +76,7 @@ public class Rectangle extends GraphShape {
*
* @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
* @param abox
- * @param lineWidth
+ * @param lineWidth line thickness, use zero for filled rectangle
*/
public Rectangle(final int renderModes, final AABBox abox, final float lineWidth) {
this( renderModes, abox.getMinX(), abox.getMinY(), abox.getWidth(), abox.getHeight(), lineWidth, abox.getCenter().z());
@@ -89,7 +90,7 @@ public class Rectangle extends GraphShape {
* @param minY
* @param width
* @param height
- * @param lineWidth
+ * @param lineWidth line thickness, use zero for filled rectangle
*/
public Rectangle(final int renderModes, final float minX, final float minY, final float width, final float height, final float lineWidth) {
this( renderModes, minX, minY, width, height, lineWidth, 0);
@@ -101,7 +102,7 @@ public class Rectangle extends GraphShape {
* @param renderModes Graph's {@link Region} render modes, see {@link GLRegion#create(GLProfile, int, TextureSequence) create(..)}.
* @param width
* @param height
- * @param lineWidth
+ * @param lineWidth line thickness, use zero for filled rectangle
*/
public Rectangle(final int renderModes, final float width, final float height, final float lineWidth) {
this( renderModes, 0, 0, width, height, lineWidth, 0);
@@ -144,9 +145,9 @@ public class Rectangle extends GraphShape {
shape.lineTo(x1, y2, z);
shape.lineTo(x1, y1, z);
shape.closeLastOutline(true);
- shape.addEmptyOutline();
}
- {
+ if( !FloatUtil.isZero(lineWidth) ) {
+ shape.addEmptyOutline();
// Inner OutlineShape as Winding.CW.
// final float dxy0 = getWidth() < getHeight() ? getWidth() : getHeight();
final float dxy = lineWidth; // dxy0 * getDebugBox();