From c1ccdf6cb756aebc2d0dbed8759d01b7eacf8a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 26 Feb 2014 16:20:19 +0100 Subject: [PATCH] Take into account the view's resolution in Item#rasterize() --- src/item/Item.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index 676ad381..0ba1d0ed 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1522,7 +1522,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{ * Rasterizes the item into a newly created Raster object. The item itself * is not removed after rasterization. * - * @param {Number} [resolution=72] the resolution of the raster in dpi + * @param {Number} [resolution=view.resolution] the resolution of the raster + * in pixels per inch (DPI). If not speceified, the value of + * {@code view.resolution} is used. * @return {Raster} the newly created raster item * * @example {@paperscript} @@ -1545,7 +1547,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{ */ rasterize: function(resolution) { var bounds = this.getStrokeBounds(), - scale = (resolution || 72) / 72, + view = this._project.view, + scale = (resolution || view && view.getResolution() || 72) / 72, // Floor top-left corner and ceil bottom-right corner, to never // blur or cut pixels. topLeft = bounds.getTopLeft().floor(),