summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Mc Neill <[email protected]>2011-03-01 12:55:10 +0000
committerHarvey Harrison <[email protected]>2011-12-31 15:06:19 -0800
commit768a1aca734aef123c94dd30c443330f0c70b3d9 (patch)
tree4f3ad904494200565e0029ec0c265c440d30cfb8
parent68c9ff9cc009124d546b24b4951e76bebd044dba (diff)
j3dutils: cherry-pick fix from svn trunk issue 657
Java3D-657: Text2D should allow for texture unit state git-svn-id: https://svn.java.net/svn/j3d-core-utils~svn/trunk@208 9497e636-51bd-65ba-982d-a4982e1767a5 Signed-off-by: Harvey Harrison <[email protected]>
-rw-r--r--src/classes/share/com/sun/j3d/utils/geometry/Text2D.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java b/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java
index 6a05558..3ec93fb 100644
--- a/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java
+++ b/src/classes/share/com/sun/j3d/utils/geometry/Text2D.java
@@ -163,6 +163,12 @@ public class Text2D extends Shape3D {
this.text = text;
Texture tex = getAppearance().getTexture();
+
+ // mcneillk: JAVA3D-657
+ if (tex == null) {
+ tex = getAppearance().getTextureUnitState(0).getTexture();
+ }
+
int width = tex.getWidth();
int height = tex.getHeight();
int oldVW = vWidth;
@@ -195,7 +201,13 @@ public class Text2D extends Shape3D {
tex.getBoundaryColor(c);
newTex.setBoundaryColor(c);
newTex.setUserData(tex.getUserData());
- getAppearance().setTexture(newTex);
+
+ // mcneillk: JAVA3D-657
+ if (getAppearance().getTexture() != null) {
+ getAppearance().setTexture(newTex);
+ } else {
+ getAppearance().getTextureUnitState(0).setTexture(newTex);
+ }
}
// Does the new text requires a new geometry ?
if ( oldVH != vHeight || oldVW != vWidth){