fixed frame's value not right when enter frame

This commit is contained in:
2youyou2 2014-06-17 15:57:06 +08:00
parent d2a6782a9e
commit c221a59954
1 changed files with 12 additions and 34 deletions

View File

@ -33,7 +33,7 @@ NS_TIMELINE_BEGIN
// Frame
Frame::Frame()
: _frameIndex(0)
, _tween(false)
, _tween(true)
, _timeline(nullptr)
, _node(nullptr)
{
@ -164,11 +164,8 @@ RotationFrame::RotationFrame()
}
void RotationFrame::onEnter(Frame *nextFrame)
{
if (!_tween || nextFrame == this)
{
_node->setRotation(_rotation);
}
if(_tween)
{
@ -217,12 +214,9 @@ SkewFrame::SkewFrame()
}
void SkewFrame::onEnter(Frame *nextFrame)
{
if (!_tween || nextFrame == this)
{
_node->setSkewX(_skewX);
_node->setSkewY(_skewY);
}
if(_tween)
{
@ -275,12 +269,9 @@ RotationSkewFrame::RotationSkewFrame()
}
void RotationSkewFrame::onEnter(Frame *nextFrame)
{
if (!_tween || nextFrame == this)
{
_node->setRotationSkewX(_skewX);
_node->setRotationSkewY(_skewY);
}
if (_tween)
{
@ -332,11 +323,8 @@ PositionFrame::PositionFrame()
}
void PositionFrame::onEnter(Frame *nextFrame)
{
if (!_tween || nextFrame == this)
{
_node->setPosition(_position);
}
if(_tween)
{
@ -388,12 +376,9 @@ ScaleFrame::ScaleFrame()
}
void ScaleFrame::onEnter(Frame *nextFrame)
{
if (!_tween || nextFrame == this)
{
_node->setScaleX(_scaleX);
_node->setScaleY(_scaleY);
}
if(_tween)
{
@ -519,15 +504,8 @@ ColorFrame::ColorFrame()
void ColorFrame::onEnter(Frame *nextFrame)
{
if (!_tween || nextFrame == this)
{
if(_alpha != _node->getOpacity())
_node->setOpacity(_alpha);
Color3B color = _node->getColor();
if(color.r != _color.r || color.g != _color.r || color.b != _color.b)
_node->setColor(_color);
}
if(_tween)
{