Skip to content

Commit 41df1fe

Browse files
author
gary
committed
Set vertical alignment of title renderer to center on init of button renderers.
Fixes display in firefox (issue #15565 on cocos2d-x and #3270 on cocos2d-html)
1 parent cff0147 commit 41df1fe

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

extensions/ccui/uiwidgets/UIButton.js

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ ccui.Button = ccui.Widget.extend(/** @lends ccui.Button# */{
116116
this._buttonDisableRenderer = new cc.Sprite();
117117
this._titleRenderer = new cc.LabelTTF("");
118118
this._titleRenderer.setAnchorPoint(0.5, 0.5);
119+
this._titleRenderer.setVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_CENTER);
119120

120121
this.addProtectedChild(this._buttonNormalRenderer, ccui.Button.NORMAL_RENDERER_ZORDER, -1);
121122
this.addProtectedChild(this._buttonClickedRenderer, ccui.Button.PRESSED_RENDERER_ZORDER, -1);

0 commit comments

Comments
 (0)