diff --git a/dist/docs/assets/js/paper.js b/dist/docs/assets/js/paper.js index e533bce9..8dab8104 100644 --- a/dist/docs/assets/js/paper.js +++ b/dist/docs/assets/js/paper.js @@ -9,7 +9,7 @@ * * All rights reserved. * - * Date: Mon Jun 22 15:17:43 2020 +0200 + * Date: Mon Jun 22 16:32:39 2020 +0200 * *** * @@ -5345,7 +5345,7 @@ var Raster = Item.extend({ source: null }, _prioritize: ['crossOrigin'], - _smoothing: true, + _smoothing: 'low', beans: true, initialize: function Raster(source, position) { @@ -5569,7 +5569,9 @@ var Raster = Item.extend({ }, setSmoothing: function(smoothing) { - this._smoothing = smoothing; + this._smoothing = typeof smoothing === 'string' + ? smoothing + : smoothing ? 'low' : 'off'; this._changed(257); }, @@ -5739,8 +5741,12 @@ var Raster = Item.extend({ this._setStyles(ctx, param, viewMatrix); + var smoothing = this._smoothing, + disabled = smoothing === 'off'; DomElement.setPrefixed( - ctx, 'imageSmoothingEnabled', this._smoothing + ctx, + disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality', + disabled ? false : smoothing ); ctx.drawImage(element, diff --git a/dist/docs/classes/Raster.html b/dist/docs/classes/Raster.html index 3d57d5ae..b398bccd 100644 --- a/dist/docs/classes/Raster.html +++ b/dist/docs/classes/Raster.html @@ -580,19 +580,21 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
Specifies if the raster should be smoothed when scaled up or if the pixels should be scaled up by repeating the nearest neighboring pixels.
+Determines if the raster is drawn with pixel smoothing when scaled up or down, and if so, at which quality its pixels are to be smoothed. The settings of this property control both the imageSmoothingEnabled
and imageSmoothingQuality
properties of the CanvasRenderingContext2D
interface.
By default, smoothing is enabled at 'low'
quality. It can be set to of 'off'
to scale the raster’s pixels by repeating the nearest neighboring pixels, or to 'low'
, 'medium'
or 'high'
to control the various degrees of available image smoothing quality.
For backward compatibility, it can can also be set to false
(= 'off'
) or true
(= 'low'
).