From 4aceaee08c846760b1556956e046b162aa78c677 Mon Sep 17 00:00:00 2001 From: Ahlwong Date: Fri, 10 Oct 2014 11:17:43 -0700 Subject: [PATCH] Fix UIButton setFontSize sync ContentSize --- cocos/ui/UIButton.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 8e938366c4..32a5f61901 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -665,6 +665,10 @@ void Button::setTitleFontSize(float size) config.fontSize = size; _titleRenderer->setTTFConfig(config); } + if (_ignoreSize) { + Size s = getVirtualRendererSize(); + this->setContentSize(s); + } _fontSize = size; }