mirror of https://github.com/axmolengine/axmol.git
Update Sprite.cpp (#2164)
This commit is contained in:
parent
ef5204385b
commit
1e178b8273
|
@ -1315,7 +1315,7 @@ void Sprite::setScaleX(float scaleX)
|
|||
void Sprite::setScaleY(float scaleY)
|
||||
{
|
||||
#ifdef AX_USE_METAL
|
||||
if (_texture->isRenderTarget())
|
||||
if (_texture &&_texture->isRenderTarget())
|
||||
scaleY = std::abs(scaleY);
|
||||
#endif
|
||||
Node::setScaleY(scaleY);
|
||||
|
@ -1444,7 +1444,7 @@ bool Sprite::isFlippedX() const
|
|||
void Sprite::setFlippedY(bool flippedY)
|
||||
{
|
||||
#ifdef AX_USE_METAL
|
||||
if (_texture->isRenderTarget())
|
||||
if (_texture && _texture->isRenderTarget())
|
||||
flippedY = !flippedY;
|
||||
#endif
|
||||
if (_flippedY != flippedY)
|
||||
|
|
Loading…
Reference in New Issue