From cf1b4c0f1088593341c9d0728e8688bea5ddeca7 Mon Sep 17 00:00:00 2001 From: lorp Date: Fri, 8 Nov 2024 03:10:55 +0000 Subject: [PATCH] =?UTF-8?q?remove=20variationsEnabled=20check=20in=20addVa?= =?UTF-8?q?riations()=20-=20there=E2=80=99s=20nothing=20wrong=20with=20a?= =?UTF-8?q?=20flag=20for=20this,=20but=20here=20is=20the=20wrong=20place?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/samsa-core.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/samsa-core.js b/src/samsa-core.js index b678883..5b8093d 100644 --- a/src/samsa-core.js +++ b/src/samsa-core.js @@ -2916,11 +2916,10 @@ class SamsaBuffer extends DataView { // - adds the variation deltas to the operands // - the arrow function keeps "this" (the buffer) in scope const addVariations = (operands) => { - const variationsEnabled = true; - if (!variationsEnabled || paint.format % 2 == 0 || operands.length == 0) // variations enabled; only odd-numbered paint formats have variations; we need operands + if (paint.format % 2 === 0) // only odd-numbered paint formats have variations; we need operands return; const varIndexBase = this.u32; // we must read this even if we don’t have an instance, otherwise reading gets out of sync - if (varIndexBase == 0xffffffff || !context.instance) // no variations for this paint; we need an instance + if (operands.length === 0 || varIndexBase === 0xffffffff || !context.instance) // we need operands; no variations for this paint; we need an instance return; const deltas = context.instance.deltaSets["COLR"]; for (let i=0; i