CtrlLib: Fixed corner case of Animage(SLIDE)

git-svn-id: svn://ultimatepp.org/upp/trunk@7748 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-09-30 07:08:42 +00:00
parent 3d34bf797d
commit bcf1050335

View file

@ -4,7 +4,7 @@ NAMESPACE_UPP
#define LLOG(x) // RLOG(x)
// #define SLOWANIMATION
#define SLOWANIMATION
#define IMAGECLASS CtrlImg
#define IMAGEFILE <CtrlLib/Ctrl.iml>
@ -36,10 +36,12 @@ void Animate(Ctrl& c, const Rect& target, int type)
if(r.bottom < target.bottom)
r.bottom += ((target.bottom - r.bottom) * t) / anitime;
if(r.GetWidth() > target.GetWidth())
r.right = (r.left + ((r.GetWidth() - target.GetWidth()) * t) / anitime);
r.right = r.left + target.GetWidth();
if(r.GetHeight() > target.GetHeight())
r.bottom = (r.top + ((r.GetHeight() - target.GetHeight()) * t) / anitime);
r.bottom = r.top + target.GetHeight();
c.SetRect(r);
if(r == target)
break;
}
else
if(type == GUIEFFECT_FADE)