From 768a1aca734aef123c94dd30c443330f0c70b3d9 Mon Sep 17 00:00:00 2001 From: Ken Mc Neill Date: Tue, 1 Mar 2011 12:55:10 +0000 Subject: 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 --- src/classes/share/com/sun/j3d/utils/geometry/Text2D.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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){ -- cgit v1.2.3