rp2040js 0.16.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/interpolator.js
CHANGED
|
@@ -102,8 +102,8 @@ class Interpolator {
|
|
|
102
102
|
const sclamp0 = bit_1.s32(result0) < bit_1.s32(this.base0) ? this.base0 : (bit_1.s32(result0) > bit_1.s32(this.base1) ? this.base1 : result0);
|
|
103
103
|
const clamp0 = ctrl0.signed ? sclamp0 : uclamp0;
|
|
104
104
|
const alpha1 = result1 & 0xff;
|
|
105
|
-
const ublend1 = bit_1.u32(this.base0) + (((alpha1 * (bit_1.u32(this.base1) - bit_1.u32(this.base0))) / 256) | 0);
|
|
106
|
-
const sblend1 = bit_1.s32(this.base0) + (((alpha1 * (bit_1.s32(this.base1) - bit_1.s32(this.base0))) / 256) | 0);
|
|
105
|
+
const ublend1 = bit_1.u32(this.base0) + (Math.floor((alpha1 * (bit_1.u32(this.base1) - bit_1.u32(this.base0))) / 256) | 0);
|
|
106
|
+
const sblend1 = bit_1.s32(this.base0) + (Math.floor((alpha1 * (bit_1.s32(this.base1) - bit_1.s32(this.base0))) / 256) | 0);
|
|
107
107
|
const blend1 = ctrl1.signed ? sblend1 : ublend1;
|
|
108
108
|
this.smresult0 = bit_1.u32(result0);
|
|
109
109
|
this.smresult1 = bit_1.u32(result1);
|
package/dist/esm/interpolator.js
CHANGED
|
@@ -98,8 +98,8 @@ export class Interpolator {
|
|
|
98
98
|
const sclamp0 = s32(result0) < s32(this.base0) ? this.base0 : (s32(result0) > s32(this.base1) ? this.base1 : result0);
|
|
99
99
|
const clamp0 = ctrl0.signed ? sclamp0 : uclamp0;
|
|
100
100
|
const alpha1 = result1 & 0xff;
|
|
101
|
-
const ublend1 = u32(this.base0) + (((alpha1 * (u32(this.base1) - u32(this.base0))) / 256) | 0);
|
|
102
|
-
const sblend1 = s32(this.base0) + (((alpha1 * (s32(this.base1) - s32(this.base0))) / 256) | 0);
|
|
101
|
+
const ublend1 = u32(this.base0) + (Math.floor((alpha1 * (u32(this.base1) - u32(this.base0))) / 256) | 0);
|
|
102
|
+
const sblend1 = s32(this.base0) + (Math.floor((alpha1 * (s32(this.base1) - s32(this.base0))) / 256) | 0);
|
|
103
103
|
const blend1 = ctrl1.signed ? sblend1 : ublend1;
|
|
104
104
|
this.smresult0 = u32(result0);
|
|
105
105
|
this.smresult1 = u32(result1);
|