aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/graph/curve/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-08-12 02:54:28 +0200
committerSven Gothel <[email protected]>2023-08-12 02:54:28 +0200
commit4226760454fccee7b8c4127ce5a326807eec547b (patch)
tree96b347ea884095e31a4f8a71c5a6f038a902e70f /src/jogl/classes/com/jogamp/graph/curve/opengl
parent19895532b6b605f3a839071c6082214b06dd89bb (diff)
Graph TextRegionUtil.drawString3D(..): Allow null `rgbaColor` w/o color-channel again, was enforced to be set in commit bb6ee81bc5514663bb7b22224fcdd5ba34a51ac6
Diffstat (limited to 'src/jogl/classes/com/jogamp/graph/curve/opengl')
-rw-r--r--src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
index 975e16e4c..62a1ecb95 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
@@ -201,7 +201,7 @@ public class TextRegionUtil {
* @param str text to be rendered
* @param rgbaColor used to fill the {@link Region#hasColorChannel() region's color-channel} if used
* and set {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} to white.
- * Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only.
+ * Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only, if not {@code null}.
* @param sampleCount desired multisampling sample count for msaa-rendering.
* The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @return the bounding box of the given string from the produced and rendered GLRegion
@@ -224,7 +224,9 @@ public class TextRegionUtil {
res.copy(region.getBounds());
}
if( !region.hasColorChannel() ) {
- renderer.setColorStatic(rgbaColor);
+ if( null != rgbaColor ) {
+ renderer.setColorStatic(rgbaColor);
+ }
} else {
renderer.setColorStatic(1, 1, 1, 1);
}
@@ -267,7 +269,7 @@ public class TextRegionUtil {
* @param str text to be rendered
* @param rgbaColor used to fill the {@link Region#hasColorChannel() region's color-channel} if used
* and set {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} to white.
- * Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only.
+ * Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only, if not {@code null}.
* @param sampleCount desired multisampling sample count for msaa-rendering.
* The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @param tmp1 temp {@link AffineTransform} to be reused
@@ -284,7 +286,9 @@ public class TextRegionUtil {
final GLRegion region = GLRegion.create(gl.getGLProfile(), renderModes, null, font, str);
final AABBox res = addStringToRegion(false /* preGrowRegion */, region, font, null, str, rgbaColor, tmp1, tmp2);
if( !region.hasColorChannel() ) {
- renderer.setColorStatic(rgbaColor);
+ if( null != rgbaColor ) {
+ renderer.setColorStatic(rgbaColor);
+ }
} else {
renderer.setColorStatic(1, 1, 1, 1);
}
@@ -325,7 +329,7 @@ public class TextRegionUtil {
* @param str text to be rendered
* @param rgbaColor used to fill the {@link Region#hasColorChannel() region's color-channel} if used
* and set {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} to white.
- * Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only.
+ * Otherwise used to set the {@link RegionRenderer#setColorStatic(Vec4f) renderer's static-color} only, if not {@code null}.
* @param sampleCount desired multisampling sample count for msaa-rendering.
* The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
* @param tmp1 temp {@link AffineTransform} to be reused
@@ -341,7 +345,9 @@ public class TextRegionUtil {
}
final AABBox res = addStringToRegion(true /* preGrowRegion */, region, font, null, str, rgbaColor, tmp1, tmp2);
if( !region.hasColorChannel() ) {
- renderer.setColorStatic(rgbaColor);
+ if( null != rgbaColor ) {
+ renderer.setColorStatic(rgbaColor);
+ }
} else {
renderer.setColorStatic(1, 1, 1, 1);
}