function CanvasView(canvas) {
		// Handle canvas argument
		if (!(canvas instanceof HTMLCanvasElement)) {
			// See if the arguments describe the view size:
			var size = Size.read(arguments);
			if (size.isZero())
				throw new Error(
						'Cannot create CanvasView with the provided argument: '
						+ canvas);
			canvas = CanvasProvider.getCanvas(size);
		}
		this._context = canvas.getContext('2d');
		// Have Item count installed mouse events.
		this._eventCounters = {};
		this._pixelRatio = 1;
/*#*/ if (__options.environment == 'browser') {
		if (PaperScope.getAttribute(canvas, 'hidpi') !== 'off') {
			// Hi-DPI Canvas support based on:
			// http://www.html5rocks.com/en/tutorials/canvas/hidpi/
			var deviceRatio = window.devicePixelRatio || 1,
				backingStoreRatio = DomElement.getPrefixValue(this._context,
						'backingStorePixelRatio') || 1;
			this._pixelRatio = deviceRatio / backingStoreRatio;
		}
/*#*/ } // __options.environment == 'browser'
		View.call(this, canvas);
	}
/**
	 * Creates a view object that wraps a newly created canvas element.
	 * 
	 * @name CanvasView#initialize
	 * @param {Size} size the size of the canvas to be created
	 */
Creates a view object that wraps a newly created canvas element.

@name CanvasView#initialize
@param {Size} size the size of the canvas to be created
Creates a view object that wraps a newly created canvas element . @name CanvasView#initialize @param { Size } size the size of the canvas to be created
function CanvasView(canvas) {
		if (!(canvas instanceof HTMLCanvasElement)) {
			var size = Size.read(arguments);
			if (size.isZero())
				throw new Error(
						'Cannot create CanvasView with the provided argument: '
						+ canvas);
			canvas = CanvasProvider.getCanvas(size);
		}
		this._context = canvas.getContext('2d');
		this._eventCounters = {};
		this._pixelRatio = 1;
 if (__options.environment == 'browser') {
		if (PaperScope.getAttribute(canvas, 'hidpi') !== 'off') {
			var deviceRatio = window.devicePixelRatio || 1,
				backingStoreRatio = DomElement.getPrefixValue(this._context,
						'backingStorePixelRatio') || 1;
			this._pixelRatio = deviceRatio / backingStoreRatio;
		}
 } 
		View.call(this, canvas);
	}
function CanvasView ( canvas ) { if ( ! ( canvas instanceof HTMLCanvasElement ) ) { var size = Size . read ( arguments ) ; if ( size . isZero ( ) ) throw new Error ( 'Cannot create CanvasView with the provided argument: ' + canvas ) ; canvas = CanvasProvider . getCanvas ( size ) ; } this . _context = canvas . getContext ( '2d' ) ; this . _eventCounters = { } ; this . _pixelRatio = 1 ; if ( __options . environment == 'browser' ) { if ( PaperScope . getAttribute ( canvas , 'hidpi' ) !== 'off' ) { var deviceRatio = window . devicePixelRatio || 1 , backingStoreRatio = DomElement . getPrefixValue ( this . _context , 'backingStorePixelRatio' ) || 1 ; this . _pixelRatio = deviceRatio / backingStoreRatio ; } } View . call ( this , canvas ) ; }
Creates a view object that wraps a newly created canvas element.
Creates a view object that wraps a newly created canvas element .
// Handle canvas argument // See if the arguments describe the view size: // Have Item count installed mouse events. /*#*/ // Hi-DPI Canvas support based on: // http://www.html5rocks.com/en/tutorials/canvas/hidpi/ /*#*/ // __options.environment == 'browser'