1 #include <lib/gui/ewidgetanimation.h>
2 #include <lib/gui/ewidget.h>
4 eWidgetAnimation::eWidgetAnimation(eWidget *widget): m_widget(widget)
9 void eWidgetAnimation::tick(int inc)
17 if (m_move_current_tick >= m_move_length)
20 m_move_current_tick = m_move_length;
22 int xdiff = m_move_end.x() - m_move_start.x();
23 int ydiff = m_move_end.y() - m_move_start.y();
25 xdiff *= m_move_current_tick;
26 xdiff /= m_move_length;
28 ydiff *= m_move_current_tick;
29 ydiff /= m_move_length;
31 ePoint res(m_move_start.x() + xdiff, m_move_start.y() + ydiff);
33 m_move_current_tick += inc;
39 void eWidgetAnimation::startMoveAnimation(ePoint start, ePoint end, int length)
41 m_move_current_tick = 0;
42 m_move_length = length;