mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Prebuilt module for commit f04dd14309
This commit is contained in:
parent
3890b346b5
commit
4a4513acae
6 changed files with 8 additions and 15 deletions
2
dist/docs/assets/js/paper.js
vendored
2
dist/docs/assets/js/paper.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sun Jul 3 14:13:50 2016 +0200
|
||||
* Date: Sun Jul 3 14:16:17 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
|
13
dist/node/canvas.js
vendored
13
dist/node/canvas.js
vendored
|
@ -21,24 +21,17 @@ var Canvas = require('canvas'),
|
|||
module.exports = function(window) {
|
||||
var HTMLCanvasElement = window.HTMLCanvasElement;
|
||||
|
||||
function getImplementation(obj) {
|
||||
// Try implForWrapper() first, fall back on obj. This appears to be
|
||||
// necessary on v7.2.2, but not anymore once we can switch to 8.0.0
|
||||
var impl = idlUtils.implForWrapper(obj);
|
||||
return impl && impl._canvas ? impl : obj;
|
||||
}
|
||||
|
||||
// Add fake HTMLCanvasElement#type property:
|
||||
Object.defineProperty(HTMLCanvasElement.prototype, 'type', {
|
||||
get: function() {
|
||||
var canvas = getImplementation(this)._canvas;
|
||||
var canvas = idlUtils.implForWrapper(this)._canvas;
|
||||
return canvas && canvas.type || 'image';
|
||||
},
|
||||
|
||||
set: function(type) {
|
||||
// Allow replacement of internal node-canvas, so we can switch to a
|
||||
// PDF canvas.
|
||||
var impl = getImplementation(this),
|
||||
var impl = idlUtils.implForWrapper(this),
|
||||
size = impl._canvas || impl;
|
||||
impl._canvas = new Canvas(size.width, size.height, type);
|
||||
impl._context = null;
|
||||
|
@ -49,7 +42,7 @@ module.exports = function(window) {
|
|||
['toBuffer', 'pngStream', 'createPNGStream', 'jpgStream', 'createJPGStream']
|
||||
.forEach(function(key) {
|
||||
HTMLCanvasElement.prototype[key] = function() {
|
||||
var canvas = getImplementation(this)._canvas;
|
||||
var canvas = idlUtils.implForWrapper(this)._canvas;
|
||||
return canvas[key].apply(canvas, arguments);
|
||||
};
|
||||
});
|
||||
|
|
2
dist/paper-core.js
vendored
2
dist/paper-core.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sun Jul 3 14:13:50 2016 +0200
|
||||
* Date: Sun Jul 3 14:16:17 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
|
2
dist/paper-core.min.js
vendored
2
dist/paper-core.min.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sun Jul 3 14:13:50 2016 +0200
|
||||
* Date: Sun Jul 3 14:16:17 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
|
2
dist/paper-full.js
vendored
2
dist/paper-full.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sun Jul 3 14:13:50 2016 +0200
|
||||
* Date: Sun Jul 3 14:16:17 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
|
2
dist/paper-full.min.js
vendored
2
dist/paper-full.min.js
vendored
|
@ -9,7 +9,7 @@
|
|||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Date: Sun Jul 3 14:13:50 2016 +0200
|
||||
* Date: Sun Jul 3 14:16:17 2016 +0200
|
||||
*
|
||||
***
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue