🪲 Fix pixel wipe effect

This commit is contained in:
Simon Schneegans
2023-02-02 10:40:16 +01:00
parent 88168553f8
commit cc6a4d8331
+9 -8
View File
@@ -44,16 +44,17 @@ var PixelWipe = class {
shader._uStartPos = shader.get_uniform_location('uStartPos'); shader._uStartPos = shader.get_uniform_location('uStartPos');
// Write all uniform values at the start of each animation. // Write all uniform values at the start of each animation.
shader.connect('begin-animation', (shader, settings, forOpening, actor) => { shader.connect(
// Because the actor position may change after the begin-animation signal is 'begin-animation', (shader, settings, forOpening, testMode, actor) => {
// called, we set the uStartPos uniform during the update callback. // Because the actor position may change after the begin-animation signal is
this._startPointerPos = global.get_pointer(); // called, we set the uStartPos uniform during the update callback.
this._actor = actor; this._startPointerPos = global.get_pointer();
this._actor = actor;
// clang-format off // clang-format off
shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_int('pixel-wipe-pixel-size')]); shader.set_uniform_float(shader._uPixelSize, 1, [settings.get_int('pixel-wipe-pixel-size')]);
// clang-format on // clang-format on
}); });
// We set the uStartPos uniform during the update callback as the actor position // We set the uStartPos uniform during the update callback as the actor position
// may not be set up properly before the begin animation callback. // may not be set up properly before the begin animation callback.