Skip to content

Commit

Permalink
Switch to offset_{width,height} when clearing context
Browse files Browse the repository at this point in the history
This enables proper browser zooming through the dpi/devicePixelRatio mechanism.
  • Loading branch information
elrnv authored and cmyr committed Mar 27, 2020
1 parent 267f514 commit 29b41d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion piet-web/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<'a> RenderContext for WebRenderContext<'a> {

fn clear(&mut self, color: Color) {
let (width, height) = match self.ctx.canvas() {
Some(canvas) => (canvas.width(), canvas.height()),
Some(canvas) => (canvas.offset_width(), canvas.offset_height()),
None => return,
/* Canvas might be null if the dom node is not in
* the document; do nothing. */
Expand Down

0 comments on commit 29b41d9

Please sign in to comment.