]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Use default canvas size if one cannot be intelligently procured 999/head
authorMoshe Brevda <mbrevda@gmail.com>
Mon, 16 Mar 2015 11:47:25 +0000 (13:47 +0200)
committerMoshe Brevda <mbrevda@gmail.com>
Mon, 16 Mar 2015 11:58:09 +0000 (13:58 +0200)
src/Chart.Core.js

index 5dccd2ef9b1cb8d7864709f5fcb72f30d5b3d674..6fa0af7629824c3a8aaccbaafa1bcab69ed1e9c9 100755 (executable)
@@ -37,8 +37,8 @@
                        }
                }
 
-               var width = this.width = computeDimension(context.canvas,'Width');
-               var height = this.height = computeDimension(context.canvas,'Height');
+               var width = this.width = computeDimension(context.canvas,'Width') || context.canvas.width;
+               var height = this.height = computeDimension(context.canvas,'Height') || context.canvas.height;
 
                // Firefox requires this to work correctly
                context.canvas.width  = width;