Skip to content

Commit 5417ae8

Browse files
committed
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-html5 into develop_BMFont
2 parents 381a77d + 54f3309 commit 5417ae8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

cocos2d/label_nodes/CCLabelTTF.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,11 +1439,17 @@ cc.LabelTTF.__labelHeightDiv.style.lineHeight = "normal";
14391439
document.body.appendChild(cc.LabelTTF.__labelHeightDiv);
14401440

14411441
cc.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

extensions/GUI/CCScrollView/CCTableView.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)