@woosh/meep-engine 2.117.13 → 2.117.14

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/build/meep.cjs CHANGED
@@ -51216,28 +51216,12 @@ function canvas2Sampler2D(canvas) {
51216
51216
  context_cache.set(canvas, context);
51217
51217
  }
51218
51218
 
51219
- const result = new Sampler2D(null, 4, width, height);
51220
-
51221
- canvasDataToSampler(result, context);
51222
-
51223
- return result;
51224
-
51225
- }
51226
-
51227
- /**
51228
- *
51229
- * @param {Sampler2D} target
51230
- * @param {CanvasRenderingContext2D} ctx
51231
- */
51232
- function canvasDataToSampler(target, ctx) {
51233
- const width = target.width;
51234
- const height = target.height;
51235
-
51236
- const imageData = ctx.getImageData(0, 0, width, height);
51219
+ const imageData = context.getImageData(0, 0, width, height);
51237
51220
 
51238
51221
  const data = imageData.data;
51239
51222
 
51240
- target.data = data;
51223
+ return new Sampler2D(data, 4, width, height);
51224
+
51241
51225
  }
51242
51226
 
51243
51227
  /**
@@ -67705,6 +67689,22 @@ const CopyShader = {
67705
67689
 
67706
67690
  };
67707
67691
 
67692
+ /**
67693
+ *
67694
+ * @param {Sampler2D} target
67695
+ * @param {CanvasRenderingContext2D} ctx
67696
+ */
67697
+ function canvasDataToSampler(target, ctx) {
67698
+ const width = target.width;
67699
+ const height = target.height;
67700
+
67701
+ const imageData = ctx.getImageData(0, 0, width, height);
67702
+
67703
+ const data = imageData.data;
67704
+
67705
+ target.data = data;
67706
+ }
67707
+
67708
67708
  /**
67709
67709
  * WebGL constant, declared explicitly to avoid issues with later THREE.js versions where it is absent
67710
67710
  * @type {number}