diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index fa6f4878b0..63aa9fb5bb 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -840,6 +840,12 @@ void Sprite::setScale(float fScale) SET_DIRTY_RECURSIVELY(); } +void Sprite::setScale(float scaleX, float scaleY) +{ + Node::setScale(scaleX, scaleY); + SET_DIRTY_RECURSIVELY(); +} + void Sprite::setVertexZ(float fVertexZ) { Node::setVertexZ(fVertexZ); diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 7ebf7ff616..0c0b652972 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -494,6 +494,7 @@ public: /// @name Functions inherited from Node virtual void setScaleX(float scaleX) override; virtual void setScaleY(float scaleY) override; + virtual void setScale(float scaleX, float scaleY) override; /** * @js NA * @lua NA