Skip to content

Commit 381296a

Browse files
committed
fix: condition
1 parent bfb4b84 commit 381296a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/core/renderers/canvas/CanvasCoreTexture.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,12 @@ export class CanvasCoreTexture extends CoreContextTexture {
138138
this.image = canvas;
139139
return { width: data.width, height: data.height };
140140
} else if (
141-
typeof ImageBitmap !== 'undefined' &&
142-
data instanceof ImageBitmap
141+
(typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) ||
142+
data instanceof HTMLImageElement
143143
) {
144144
this.image = data;
145145
return { width: data.width, height: data.height };
146146
}
147-
if (data instanceof HTMLImageElement) {
148-
this.image = data;
149-
return { width: data.width, height: data.height };
150-
}
151147
return { width: 0, height: 0 };
152148
}
153149
}

0 commit comments

Comments
 (0)