add cancelAnimations() function

refs #34
This commit is contained in:
Konstantin Käfer
2014-02-07 16:08:17 +01:00
parent 26433e3288
commit 28ee5968f8
2 changed files with 5 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ public:
// Animations
bool needsAnimation() const;
void updateAnimations();
void cancelAnimations();
// Relative changes
void moveBy(double dx, double dy);

View File

@@ -28,6 +28,10 @@ void Transform::updateAnimations() {
});
}
void Transform::cancelAnimations() {
animations.clear();
}
void Transform::moveBy(double dx, double dy) {
x += cos(angle) * dx + sin(angle) * dy;
y += cos(angle) * dy + sin(-angle) * dx;