diff --git a/src/twgl.js b/src/twgl.js
index <HASH>..<HASH> 100644
--- a/src/twgl.js
+++ b/src/twgl.js
@@ -289,10 +289,10 @@ define([
   function resizeCanvasToDisplaySize(canvas, multiplier) {
     multiplier = multiplier || 1;
     multiplier = Math.max(1, multiplier);
-    var width  = canvas.clientWidth  * multiplier | 0;
-    var height = canvas.clientHeight * multiplier | 0;
-    if (canvas.width !== width ||
-        canvas.height !== height) {
+    var bounds = canvas.getBoundingClientRect();
+    var width  = Math.round(bounds.width  * multiplier);
+    var height = Math.round(bounds.height * multiplier);
+    if (canvas.width !== width || canvas.height !== height) {
       canvas.width = width;
       canvas.height = height;
       return true;
use getBoundingClientRect for resizeCanvasToMatchDisplaySize

When using devicePixelRatio this is important because getBoundingClientRect
returns fractional sizes. Those fractions matter when taking devicePixelRatio
into account.