This saves evaluating a new paintedSize and doing a bunch of evaluations
for no reason.
More importantly it works round a Qt animation crash.
CCBUG: 381105
broulik | |
mart |
Plasma |
This saves evaluating a new paintedSize and doing a bunch of evaluations
for no reason.
More importantly it works round a Qt animation crash.
CCBUG: 381105
Cloned this code whilst making a tiny reproducible test case
Found swapping these lines made that go away
Given it results in less processing we may as well do it.
End user result is the same.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
To expand on the crash:
Killer line is
fadeAnim.running = Qt.binding(function() {
return currentImage.status !== Image.Loading && otherImage.status !== Image.Loading })
the idea being to delay the loading until both things are loaded.
But scriptAnimation at the end does:
otherImage.fillMode = fillMode;
otherImage.source = "";
which means from inside the animation we change fillMode - running goes to false as it reloads the image with the new fillMode (asynchronously)
then we unset the source, running goes to true as it's no longer loading
We're completely restarting the animation from within the animation.
Qt doesn't like that.