From 02885feae190627d07e506eff30ea93cabc31611 Mon Sep 17 00:00:00 2001 From: Joel Brandt Date: Wed, 25 Jun 2014 17:37:02 -0700 Subject: [PATCH] add config parameter use-psd-smart-object-pixel-scaling --- lib/renderer.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/renderer.js b/lib/renderer.js index 87c6e22c..04b2bf94 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -66,6 +66,10 @@ if (config.hasOwnProperty("allow-dither")) { this._allowDither = !!config["allow-dither"]; } + + if (config.hasOwnProperty("use-psd-smart-object-pixel-scaling")) { + this._forceSmartPSDPixelScaling = !!config["use-psd-smart-object-pixel-scaling"]; + } } /** @@ -83,6 +87,11 @@ */ BaseRenderer.prototype._allowDither = undefined; + /** + * @type {boolean=} + */ + BaseRenderer.prototype._forceSmartPSDPixelScaling = undefined; + /** * Convert a value in a given unit, at particular resolution, to a value in pixels per inch. * @@ -342,6 +351,10 @@ pixmapSettings.interpolationType = this._interpolationType; } + if (this._forceSmartPSDPixelScaling !== undefined) { + pixmapSettings.forceSmartPSDPixelScaling = this._forceSmartPSDPixelScaling; + } + return this._generator.getPixmap(this._document.id, layer.id, pixmapSettings).then(function (pixmap) { var padding = pixmapSettings.hasOwnProperty("getPadding") ? pixmapSettings.getPadding(pixmap.width, pixmap.height) : undefined,