mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Prebuilt module for commit 5167ab37fa7f4e435e093009f6de38caf7658e3d
This commit is contained in:
parent
9939f219e7
commit
fdbab46e5d
7 changed files with 56 additions and 26 deletions
14
dist/docs/assets/js/paper.js
vendored
14
dist/docs/assets/js/paper.js
vendored
|
@ -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,
|
||||
|
|
13
dist/docs/classes/Raster.html
vendored
13
dist/docs/classes/Raster.html
vendored
|
@ -580,19 +580,21 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
|
|||
<div class="member-description hidden">
|
||||
|
||||
<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>'low'</code> quality. It can be set to of <code>'off'</code> to scale the raster’s pixels by repeating the nearest neighboring pixels, or to <code>'low'</code>, <code>'medium'</code> or <code>'high'</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>'off'</code>) or <code>true</code> (= <code>'low'</code>).</p>
|
||||
|
||||
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Default:</h4>
|
||||
<li><tt>true</tt></li>
|
||||
<li><tt>'low'</tt></li>
|
||||
</ul>
|
||||
|
||||
<ul class="member-list">
|
||||
<h4>Type:</h4>
|
||||
<li>
|
||||
<tt>Boolean</tt>
|
||||
<tt>String</tt>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -606,9 +608,8 @@ console.log(view.element.toDataURL('image/png').substring(0, 32));
|
|||
</div>
|
||||
|
||||
<script type="text/paperscript" canvas="canvas-6">
|
||||
var raster = new Raster({
|
||||
source: 'http://assets.paperjs.org/images/marilyn.jpg',
|
||||
smoothing: false
|
||||
var raster = new Raster({source:
|
||||
'http://assets.paperjs.org/images/marilyn.jpg', smoothing: 'off'
|
||||
});
|
||||
raster.scale(5);
|
||||
</script>
|
||||
|
|
14
dist/paper-core.js
vendored
14
dist/paper-core.js
vendored
|
@ -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
|
||||
*
|
||||
***
|
||||
*
|
||||
|
@ -5342,7 +5342,7 @@ var Raster = Item.extend({
|
|||
source: null
|
||||
},
|
||||
_prioritize: ['crossOrigin'],
|
||||
_smoothing: true,
|
||||
_smoothing: 'low',
|
||||
beans: true,
|
||||
|
||||
initialize: function Raster(source, position) {
|
||||
|
@ -5566,7 +5566,9 @@ var Raster = Item.extend({
|
|||
},
|
||||
|
||||
setSmoothing: function(smoothing) {
|
||||
this._smoothing = smoothing;
|
||||
this._smoothing = typeof smoothing === 'string'
|
||||
? smoothing
|
||||
: smoothing ? 'low' : 'off';
|
||||
this._changed(257);
|
||||
},
|
||||
|
||||
|
@ -5736,8 +5738,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,
|
||||
|
|
4
dist/paper-core.min.js
vendored
4
dist/paper-core.min.js
vendored
File diff suppressed because one or more lines are too long
14
dist/paper-full.js
vendored
14
dist/paper-full.js
vendored
|
@ -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,
|
||||
|
|
4
dist/paper-full.min.js
vendored
4
dist/paper-full.min.js
vendored
File diff suppressed because one or more lines are too long
19
dist/paper.d.ts
vendored
19
dist/paper.d.ts
vendored
|
@ -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
|
||||
*
|
||||
* This is an auto-generated type definition.
|
||||
*/
|
||||
|
@ -5337,10 +5337,21 @@ declare namespace paper {
|
|||
crossOrigin: string
|
||||
|
||||
/**
|
||||
* 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'`).
|
||||
*/
|
||||
smoothing: boolean
|
||||
smoothing: string
|
||||
|
||||
/**
|
||||
* The event handler function to be called when the underlying image has
|
||||
|
|
Loading…
Reference in a new issue