@scratch/scratch-render 12.1.2 → 12.2.0
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/node/scratch-render.js +6 -3
- package/dist/node/scratch-render.js.map +1 -1
- package/dist/web/scratch-render.js +6 -3
- package/dist/web/scratch-render.js.map +1 -1
- package/dist/web/scratch-render.min.js +6 -3
- package/dist/web/scratch-render.min.js.map +1 -1
- package/package.json +6 -6
- package/src/BitmapSkin.js +4 -3
|
@@ -190633,9 +190633,12 @@ var BitmapSkin = /*#__PURE__*/function (_Skin) {
|
|
|
190633
190633
|
// memory.
|
|
190634
190634
|
var textureData = bitmapData;
|
|
190635
190635
|
if (bitmapData instanceof HTMLCanvasElement) {
|
|
190636
|
-
// Given a HTMLCanvasElement get the image data to pass to
|
|
190637
|
-
//
|
|
190638
|
-
|
|
190636
|
+
// Given a HTMLCanvasElement, get the image data to pass to WebGL and the Silhouette. The 2D context was
|
|
190637
|
+
// likely already created, so `willReadFrequently` is likely ignored here, but it's good documentation and
|
|
190638
|
+
// may help if the code path changes someday.
|
|
190639
|
+
var context = bitmapData.getContext('2d', {
|
|
190640
|
+
willReadFrequently: true
|
|
190641
|
+
});
|
|
190639
190642
|
textureData = context.getImageData(0, 0, bitmapData.width, bitmapData.height);
|
|
190640
190643
|
}
|
|
190641
190644
|
if (this._texture === null) {
|