Added cloneFields() method to BitmapText thought it's probably

fruitless since BitmapText isn't even properly saveable and couldn't
possibly have worked for any dynamic text with the old clone()
method.
Also a bunch of white space changes removing spaces at the ends of
lines.
cleanup_build_scripts
Paul Speed 9 years ago
parent 3f1c696e26
commit 2f246b25bb
  1. 20
      jme3-core/src/main/java/com/jme3/font/BitmapText.java

@ -38,6 +38,7 @@ import com.jme3.material.Material;
import com.jme3.math.ColorRGBA; import com.jme3.math.ColorRGBA;
import com.jme3.renderer.RenderManager; import com.jme3.renderer.RenderManager;
import com.jme3.scene.Node; import com.jme3.scene.Node;
import com.jme3.util.clone.Cloner;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -84,6 +85,25 @@ public class BitmapText extends Node {
return clone; return clone;
} }
/**
* Called internally by com.jme3.util.clone.Cloner. Do not call directly.
*/
@Override
public void cloneFields( Cloner cloner, Object original ) {
for( int i = 0; i < textPages.length; i++ ) {
textPages[i] = cloner.clone(textPages[i]);
}
this.block = cloner.clone(block);
// Change in behavior: The 'letters' field was not cloned or recreated
// before. I'm not sure how this worked and suspect BitmapText was just
// not cloneable if you planned to change the text later. -pspeed
this.letters = new Letters(font, block, letters.getQuad().isRightToLeft());
// Just noticed BitmapText is not even writable/readable really...
// so I guess cloning doesn't come up that often.
}
public BitmapFont getFont() { public BitmapFont getFont() {
return font; return font;
} }

Loading…
Cancel
Save