Correct super update order

This commit is contained in:
Lukas Klingsbo
2020-05-15 17:08:59 +02:00
parent d976d07b2d
commit 7bcd6efb68
2 changed files with 2 additions and 3 deletions

View File

@ -49,13 +49,12 @@ class MoveEffect extends PositionComponentEffect {
@override
void update(double dt) {
super.update(dt);
if (!hasFinished()) {
final double c = curve?.transform(percentage) ?? 1.0;
component.x = _xOriginal + _xDistance * c * _xDirection;
component.y = _yOriginal + _yDistance * c * _yDirection;
}
super.update(dt);
}
}

View File

@ -46,12 +46,12 @@ class ScaleEffect extends PositionComponentEffect {
@override
void update(double dt) {
super.update(dt);
if (!hasFinished()) {
final double c = curve?.transform(percentage) ?? 1.0;
component.width = _original.width + _diff.width * c * _dir.x;
component.height = _original.height + _diff.height * c * _dir.y;
}
super.update(dt);
}
}