瀏覽代碼

Adding a comment hinting at maybe why jme nifty text
used to work better and then broke at some point.
The older previously commented out code provided a
better text width value than BitmapFont did before
the recent fixes.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@6986 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

PSp..om 14 年之前
父節點
當前提交
3fe5911b66
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. 7 1
      engine/src/niftygui/com/jme3/niftygui/RenderFontJme.java

+ 7 - 1
engine/src/niftygui/com/jme3/niftygui/RenderFontJme.java

@@ -80,7 +80,13 @@ public class RenderFontJme implements RenderFont {
     public int getWidth(final String str) {
         if (str.length() == 0)
             return 0;
-        
+ 
+        // Note: BitmapFont is now fixed to return the proper line width
+        //       at least for now.  The older commented out (by someone else, not me)
+        //       code below is arguably 'more accurate' if BitmapFont gets
+        //       buggy again.  The issue is that the BitmapText and BitmapFont
+        //       use a different algorithm for calculating size and both must
+        //       be modified in sync.       
         int result = (int) font.getLineWidth(str);
 //        text.setText(str);
 //        text.updateLogicalState(0);