File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 903
903
904
904
cc . LabelTTF . __labelHeightDiv = document . createElement ( "div" ) ;
905
905
cc . LabelTTF . __labelHeightDiv . style . fontFamily = "Arial" ;
906
- cc . LabelTTF . __labelHeightDiv . innerHTML = "ajghl~!" ;
907
906
cc . LabelTTF . __labelHeightDiv . style . position = "absolute" ;
908
907
cc . LabelTTF . __labelHeightDiv . style . left = "-100px" ;
909
908
cc . LabelTTF . __labelHeightDiv . style . top = "-100px" ;
@@ -914,10 +913,12 @@ cc.LabelTTF.__getFontHeightByDiv = function(fontName, fontSize){
914
913
var clientHeight = cc . LabelTTF . __fontHeightCache [ fontName + "." + fontSize ] ;
915
914
if ( clientHeight > 0 ) return clientHeight ;
916
915
var labelDiv = cc . LabelTTF . __labelHeightDiv ;
916
+ labelDiv . innerHTML = "ajghl~!" ;
917
917
labelDiv . style . fontFamily = fontName ;
918
918
labelDiv . style . fontSize = fontSize + "px" ;
919
919
clientHeight = labelDiv . clientHeight ;
920
920
cc . LabelTTF . __fontHeightCache [ fontName + "." + fontSize ] = clientHeight ;
921
+ labelDiv . innerHTML = "" ;
921
922
return clientHeight ;
922
923
} ;
923
924
You can’t perform that action at this time.
0 commit comments