From 4d1d225bd17112fac862157b58f684fe99338c61 Mon Sep 17 00:00:00 2001 From: CaiWenzhi Date: Mon, 6 Jan 2014 15:07:04 +0800 Subject: [PATCH] Fixed bugs and memory leak --- cocos/gui/UILayout.cpp | 1 + cocos/gui/UIText.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cocos/gui/UILayout.cpp b/cocos/gui/UILayout.cpp index 1462a58545..c9dffd1818 100644 --- a/cocos/gui/UILayout.cpp +++ b/cocos/gui/UILayout.cpp @@ -85,6 +85,7 @@ _currentAlphaTestRef(1) Layout::~Layout() { + setClippingEnabled(false); } void Layout::onEnter() diff --git a/cocos/gui/UIText.cpp b/cocos/gui/UIText.cpp index 91815575b1..a6f22997bf 100644 --- a/cocos/gui/UIText.cpp +++ b/cocos/gui/UIText.cpp @@ -140,13 +140,11 @@ void Text::setScale(float fScale) void Text::setScaleX(float fScaleX) { Widget::setScaleX(fScaleX); - _normalScaleValueX = fScaleX; } void Text::setScaleY(float fScaleY) { Widget::setScaleY(fScaleY); - _normalScaleValueY = fScaleY; } bool Text::isTouchScaleChangeEnabled() @@ -169,6 +167,8 @@ void Text::onPressStateChangedToPressed() { return; } + _normalScaleValueX = getScaleX(); + _normalScaleValueY = getScaleY(); clickScale(_normalScaleValueX + _onSelectedScaleOffset, _normalScaleValueY + _onSelectedScaleOffset); }