File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
extensions/GUI/CCScrollView Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1439,11 +1439,17 @@ cc.LabelTTF.__labelHeightDiv.style.lineHeight = "normal";
14391439document . body . appendChild ( cc . LabelTTF . __labelHeightDiv ) ;
14401440
14411441cc . LabelTTF . __getFontHeightByDiv = function ( fontName , fontSize ) {
1442+ var clientHeight = cc . LabelTTF . __fontHeightCache [ fontName + "." + fontSize ] ;
1443+ if ( clientHeight > 0 ) return clientHeight ;
14421444 var labelDiv = cc . LabelTTF . __labelHeightDiv ;
14431445 labelDiv . style . fontFamily = fontName ;
14441446 labelDiv . style . fontSize = fontSize + "px" ;
1445- return labelDiv . clientHeight ;
1447+ clientHeight = labelDiv . clientHeight ;
1448+ cc . LabelTTF . __fontHeightCache [ fontName + "." + fontSize ] = clientHeight ;
1449+ return clientHeight ;
14461450} ;
14471451
1452+ cc . LabelTTF . __fontHeightCache = { } ;
1453+
14481454
14491455
Original file line number Diff line number Diff line change @@ -376,6 +376,7 @@ cc.TableView = cc.ScrollView.extend({
376376 * reloads data from data source. the view will be refreshed.
377377 */
378378 reloadData :function ( ) {
379+ this . _oldDirection = cc . SCROLLVIEW_DIRECTION_NONE ;
379380 var locCellsUsed = this . _cellsUsed ;
380381 for ( var i = 0 ; i < locCellsUsed . count ( ) ; i ++ ) {
381382 var cell = locCellsUsed . objectAtIndex ( i ) ;
You can’t perform that action at this time.
0 commit comments