src/hft/scripts/misc/misc.js
function(canvas, useDevicePixelRatio) {
    var mult = useDevicePixelRatio ? window.devicePixelRatio : 1;
    mult = mult || 1;
    var width  = Math.floor(canvas.clientWidth  * mult);
    var height = Math.floor(canvas.clientHeight * mult);
    if (canvas.width !== width ||
        canvas.height !== height) {
      canvas.width = width;
      canvas.height = height;
      return true;
    }
  }
function(canvas, useDevicePixelRatio) {
    var mult = useDevicePixelRatio ? window.devicePixelRatio : 1;
    mult = mult || 1;
    var width  = Math.floor(canvas.clientWidth  * mult);
    var height = Math.floor(canvas.clientHeight * mult);
    if (canvas.width !== width ||
        canvas.height !== height) {
      canvas.width = width;
      canvas.height = height;
      return true;
    }
  }
function ( canvas , useDevicePixelRatio ) { var mult = useDevicePixelRatio ? window . devicePixelRatio : 1 ; mult = mult || 1 ; var width = Math . floor ( canvas . clientWidth * mult ) ; var height = Math . floor ( canvas . clientHeight * mult ) ; if ( canvas . width !== width || canvas . height !== height ) { canvas . width = width ; canvas . height = height ; return true ; } }
Resizes a cavnas to match its CSS displayed size.
@param {Canvas} canvas canvas to resize.
@param {boolean?} useDevicePixelRatio if true canvas will be
created to match devicePixelRatio.
@memberOf module:Misc
Resizes a cavnas to match its CSS displayed size .