From 735397f16e30476fa8ba5f643030643bfb6d80ea Mon Sep 17 00:00:00 2001 From: Paul Speed Date: Sun, 4 Dec 2016 15:31:30 -0500 Subject: [PATCH] Another fix for BitmapText cloning where the regular clone() was completely bypassing the JME cloner framework... and making a bad clone. --- jme3-core/src/main/java/com/jme3/font/BitmapText.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/font/BitmapText.java b/jme3-core/src/main/java/com/jme3/font/BitmapText.java index 714f811c8..57ed33893 100644 --- a/jme3-core/src/main/java/com/jme3/font/BitmapText.java +++ b/jme3-core/src/main/java/com/jme3/font/BitmapText.java @@ -76,13 +76,7 @@ public class BitmapText extends Node { @Override public BitmapText clone() { - BitmapText clone = (BitmapText) super.clone(); - for (int i = 0; i < textPages.length; i++) { - clone.textPages[i] = textPages[i].clone(); - } - clone.block = block.clone(); - clone.needRefresh = true; - return clone; + return (BitmapText)super.clone(false); } /** @@ -105,7 +99,7 @@ public class BitmapText extends Node { // 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, this.block, letters.getQuad().isRightToLeft()); + 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.