File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ function parseExtensionBlock(
154154
155155/**
156156 * __read `len` bits from `imageData` at `pos`__
157- * @param imageData - `Uint8ClampedArray ` to read from
157+ * @param imageData - `Uint8Array ` to read from
158158 * @param pos - bit position in `imageData`
159159 * @param len - bit length to read [1-12 bits]
160160 * @returns `len` bits at `pos`
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ export class ImageDrawer implements IShapeDrawer<ImageParticle> {
3232 * @param image - the image to add to the container collection
3333 */
3434 addImage ( image : IImage ) : void {
35- this . _engine . images ?. push ( image ) ;
35+ this . _engine . images ??= [ ] ;
36+
37+ this . _engine . images . push ( image ) ;
3638 }
3739
3840 /**
@@ -98,7 +100,9 @@ export class ImageDrawer implements IShapeDrawer<ImageParticle> {
98100 return ;
99101 }
100102
101- const image = this . _engine . images ?. find ( ( t : IImage ) => t . name === imageData . name || t . source === imageData . src ) ;
103+ this . _engine . images ??= [ ] ;
104+
105+ const image = this . _engine . images . find ( ( t : IImage ) => t . name === imageData . name || t . source === imageData . src ) ;
102106
103107 if ( image ) {
104108 return ;
@@ -119,6 +123,8 @@ export class ImageDrawer implements IShapeDrawer<ImageParticle> {
119123 return ;
120124 }
121125
126+ this . _engine . images ??= [ ] ;
127+
122128 const images = this . _engine . images ,
123129 imageData = particle . shapeData as IImageShape | undefined ;
124130
@@ -127,7 +133,7 @@ export class ImageDrawer implements IShapeDrawer<ImageParticle> {
127133 }
128134
129135 const color = particle . getFillColor ( ) ,
130- image = images ? .find ( ( t : IImage ) => t . name === imageData . name || t . source === imageData . src ) ;
136+ image = images . find ( ( t : IImage ) => t . name === imageData . name || t . source === imageData . src ) ;
131137
132138 if ( ! image ) {
133139 return ;
You can’t perform that action at this time.
0 commit comments