From 4de12d426cf0a7e5587f2ca68c505f160bf996cf Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Thu, 31 Mar 2022 21:25:32 +0200 Subject: [PATCH] :wrench: Obey test mode --- src/SnapOfDisintegration.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SnapOfDisintegration.js b/src/SnapOfDisintegration.js index f5c8c8d..4e9b589 100644 --- a/src/SnapOfDisintegration.js +++ b/src/SnapOfDisintegration.js @@ -132,6 +132,9 @@ if (utils.isInShellProcess()) { // The dust particles will fade to this color over time. const color = Clutter.Color.from_string(settings.get_string('snap-color'))[1]; + // If we are currently performing integration test, the animation uses a fixed seed. + const testMode = settings.get_boolean('test-mode'); + this.set_shader_source(` // Inject some common shader snippets. @@ -140,7 +143,8 @@ if (utils.isInShellProcess()) { uniform sampler2D uDustTexture; - const vec2 SEED = vec2(${Math.random()}, ${Math.random()}); + const vec2 SEED = vec2(${testMode ? 0 : Math.random()}, + ${testMode ? 0 : Math.random()}); const float DUST_SCALE = ${settings.get_double('snap-scale')}; const float DUST_LAYERS = 5; const float ACTOR_SCALE = 1.2;