Allow 'false' as well as 'off' for hidpi attribute, since that's what's in use for other attributes as well.

This commit is contained in:
Jürg Lehni 2014-09-26 18:03:37 +02:00
parent 762113230a
commit dd99db8d2d
2 changed files with 2 additions and 2 deletions

View file

@ -536,7 +536,7 @@ var PathItem = Item.extend(/** @lends PathItem# */{
* path2.add(new Point(180, 25)); * path2.add(new Point(180, 25));
* *
* // To draw an arc in anticlockwise direction, * // To draw an arc in anticlockwise direction,
* // we pass 'false' as the second argument to arcTo: * // we pass `false` as the second argument to arcTo:
* path2.arcTo(new Point(280, 25), false); * path2.arcTo(new Point(280, 25), false);
* *
* @example {@paperscript height=300} * @example {@paperscript height=300}

View file

@ -47,7 +47,7 @@ var CanvasView = View.extend(/** @lends CanvasView# */{
this._eventCounters = {}; this._eventCounters = {};
this._pixelRatio = 1; this._pixelRatio = 1;
/*#*/ if (__options.environment == 'browser') { /*#*/ if (__options.environment == 'browser') {
if (PaperScope.getAttribute(canvas, 'hidpi') !== 'off') { if (!/^off|false$/.test(PaperScope.getAttribute(canvas, 'hidpi'))) {
// Hi-DPI Canvas support based on: // Hi-DPI Canvas support based on:
// http://www.html5rocks.com/en/tutorials/canvas/hidpi/ // http://www.html5rocks.com/en/tutorials/canvas/hidpi/
var deviceRatio = window.devicePixelRatio || 1, var deviceRatio = window.devicePixelRatio || 1,