Add canvas usability checks to drawImage()

This commit is contained in:
pylbrecht 2020-02-03 21:48:41 +01:00
parent ed0973fb1c
commit 423b86e439
5 changed files with 14 additions and 13 deletions

View file

@ -138,6 +138,10 @@ impl OffscreenCanvas {
));
Some(context)
}
pub fn is_valid(&self) -> bool {
self.Width() != 0 && self.Height() != 0
}
}
impl OffscreenCanvasMethods for OffscreenCanvas {