mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix null error on window resizing (#2501)
* Fix null error on window resizing * Be more specific in type cast (dae)
This commit is contained in:
parent
c54b897b4f
commit
eebd143a9f
2 changed files with 6 additions and 1 deletions
|
@ -120,6 +120,7 @@ Ben Kerman <ben@kermanic.org>
|
|||
Euan Kemp <euank@euank.com>
|
||||
Kieran Black <kieranlblack@gmail.com>
|
||||
XeR <github.com/XeR>
|
||||
Austin Siew <github.com/Aquafina-water-bottle>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -12,7 +12,11 @@ export function setupImageCloze(): void {
|
|||
}
|
||||
|
||||
function setupImageClozeInner(): void {
|
||||
const canvas: HTMLCanvasElement = document.querySelector("canvas")! as HTMLCanvasElement;
|
||||
const canvas = document.querySelector("canvas") as HTMLCanvasElement | null;
|
||||
if (canvas == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
canvas.style.maxWidth = "100%";
|
||||
canvas.style.maxHeight = "95vh";
|
||||
|
||||
|
|
Loading…
Reference in a new issue