Reset canvas state when changing bitmap dimensions

This commit is contained in:
David Zbarsky 2015-11-28 16:47:28 -08:00
parent b4906aa008
commit 302f41d34b
4 changed files with 103 additions and 2 deletions

View file

@ -81,7 +81,7 @@ impl HTMLCanvasElement {
let size = self.get_size();
if let Some(ref context) = *self.context.borrow() {
match *context {
CanvasContext::Context2d(ref context) => context.recreate(size),
CanvasContext::Context2d(ref context) => context.set_bitmap_dimensions(size),
CanvasContext::WebGL(ref context) => context.recreate(size),
}
}