Prebuilt module for commit 5167ab37fa7f4e435e093009f6de38caf7658e3d

This commit is contained in:
Paper.js Bot 2020-06-22 15:18:17 +00:00
parent 9939f219e7
commit fdbab46e5d
7 changed files with 56 additions and 26 deletions

View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * 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 source: null
}, },
_prioritize: ['crossOrigin'], _prioritize: ['crossOrigin'],
_smoothing: true, _smoothing: 'low',
beans: true, beans: true,
initialize: function Raster(source, position) { initialize: function Raster(source, position) {
@ -5569,7 +5569,9 @@ var Raster = Item.extend({
}, },
setSmoothing: function(smoothing) { setSmoothing: function(smoothing) {
this._smoothing = smoothing; this._smoothing = typeof smoothing === 'string'
? smoothing
: smoothing ? 'low' : 'off';
this._changed(257); this._changed(257);
}, },
@ -5739,8 +5741,12 @@ var Raster = Item.extend({
this._setStyles(ctx, param, viewMatrix); this._setStyles(ctx, param, viewMatrix);
var smoothing = this._smoothing,
disabled = smoothing === 'off';
DomElement.setPrefixed( DomElement.setPrefixed(
ctx, 'imageSmoothingEnabled', this._smoothing ctx,
disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality',
disabled ? false : smoothing
); );
ctx.drawImage(element, ctx.drawImage(element,

View file

@ -580,19 +580,21 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
<div class="member-description hidden"> <div class="member-description hidden">
<div class="member-text"> <div class="member-text">
<p>Specifies if the raster should be smoothed when scaled up or if the pixels should be scaled up by repeating the nearest neighboring pixels.</p> <p>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 <code>imageSmoothingEnabled</code> and <code>imageSmoothingQuality</code> properties of the <code>CanvasRenderingContext2D</code> interface.</p>
<p>By default, smoothing is enabled at <code>&#39;low&#39;</code> quality. It can be set to of <code>&#39;off&#39;</code> to scale the raster&rsquo;s pixels by repeating the nearest neighboring pixels, or to <code>&#39;low&#39;</code>, <code>&#39;medium&#39;</code> or <code>&#39;high&#39;</code> to control the various degrees of available image smoothing quality.</p>
<p>For backward compatibility, it can can also be set to <code>false</code> (= <code>&#39;off&#39;</code>) or <code>true</code> (= <code>&#39;low&#39;</code>).</p>
<ul class="member-list"> <ul class="member-list">
<h4>Default:</h4> <h4>Default:</h4>
<li><tt>true</tt></li> <li><tt>'low'</tt></li>
</ul> </ul>
<ul class="member-list"> <ul class="member-list">
<h4>Type:</h4> <h4>Type:</h4>
<li> <li>
<tt>Boolean</tt> <tt>String</tt>
</li> </li>
</ul> </ul>
@ -606,9 +608,8 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
</div> </div>
<script type="text/paperscript" canvas="canvas-6"> <script type="text/paperscript" canvas="canvas-6">
var raster = new Raster({ var raster = new Raster({source:
source: 'http://assets.paperjs.org/images/marilyn.jpg', 'http://assets.paperjs.org/images/marilyn.jpg', smoothing: 'off'
smoothing: false
}); });
raster.scale(5); raster.scale(5);
</script> </script>

14
dist/paper-core.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Mon Jun 22 15:17:43 2020 +0200 * Date: Mon Jun 22 16:32:39 2020 +0200
* *
*** ***
* *
@ -5342,7 +5342,7 @@ var Raster = Item.extend({
source: null source: null
}, },
_prioritize: ['crossOrigin'], _prioritize: ['crossOrigin'],
_smoothing: true, _smoothing: 'low',
beans: true, beans: true,
initialize: function Raster(source, position) { initialize: function Raster(source, position) {
@ -5566,7 +5566,9 @@ var Raster = Item.extend({
}, },
setSmoothing: function(smoothing) { setSmoothing: function(smoothing) {
this._smoothing = smoothing; this._smoothing = typeof smoothing === 'string'
? smoothing
: smoothing ? 'low' : 'off';
this._changed(257); this._changed(257);
}, },
@ -5736,8 +5738,12 @@ var Raster = Item.extend({
this._setStyles(ctx, param, viewMatrix); this._setStyles(ctx, param, viewMatrix);
var smoothing = this._smoothing,
disabled = smoothing === 'off';
DomElement.setPrefixed( DomElement.setPrefixed(
ctx, 'imageSmoothingEnabled', this._smoothing ctx,
disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality',
disabled ? false : smoothing
); );
ctx.drawImage(element, ctx.drawImage(element,

File diff suppressed because one or more lines are too long

14
dist/paper-full.js vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * 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 source: null
}, },
_prioritize: ['crossOrigin'], _prioritize: ['crossOrigin'],
_smoothing: true, _smoothing: 'low',
beans: true, beans: true,
initialize: function Raster(source, position) { initialize: function Raster(source, position) {
@ -5569,7 +5569,9 @@ var Raster = Item.extend({
}, },
setSmoothing: function(smoothing) { setSmoothing: function(smoothing) {
this._smoothing = smoothing; this._smoothing = typeof smoothing === 'string'
? smoothing
: smoothing ? 'low' : 'off';
this._changed(257); this._changed(257);
}, },
@ -5739,8 +5741,12 @@ var Raster = Item.extend({
this._setStyles(ctx, param, viewMatrix); this._setStyles(ctx, param, viewMatrix);
var smoothing = this._smoothing,
disabled = smoothing === 'off';
DomElement.setPrefixed( DomElement.setPrefixed(
ctx, 'imageSmoothingEnabled', this._smoothing ctx,
disabled ? 'imageSmoothingEnabled' : 'imageSmoothingQuality',
disabled ? false : smoothing
); );
ctx.drawImage(element, ctx.drawImage(element,

File diff suppressed because one or more lines are too long

19
dist/paper.d.ts vendored
View file

@ -9,7 +9,7 @@
* *
* All rights reserved. * All rights reserved.
* *
* Date: Mon Jun 22 15:17:43 2020 +0200 * Date: Mon Jun 22 16:32:39 2020 +0200
* *
* This is an auto-generated type definition. * This is an auto-generated type definition.
*/ */
@ -5337,10 +5337,21 @@ declare namespace paper {
crossOrigin: string crossOrigin: string
/** /**
* Specifies if the raster should be smoothed when scaled up or if the * Determines if the raster is drawn with pixel smoothing when scaled up or
* pixels should be scaled up by repeating the nearest neighboring pixels. * 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'`).
*/ */
smoothing: boolean smoothing: string
/** /**
* The event handler function to be called when the underlying image has * The event handler function to be called when the underlying image has