mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js: Bump version number to 0.9.1 Fix issue with local paper variable shielding global one. Reset transformation matrix when blitting off-screen canvas.
This commit is contained in:
commit
8d1e5ea144
4 changed files with 6 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "paper",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"main": "./src/node/index.js",
|
||||
"engines": { "node": ">= 0.4.0" },
|
||||
"dependencies": {
|
||||
|
|
|
@ -27,7 +27,7 @@ var PaperScopeItem = Base.extend(Callback, /** @lends PaperScopeItem# */{
|
|||
initialize: function(activate) {
|
||||
// Store reference to the currently active global paper scope:
|
||||
this._scope = paper;
|
||||
// Push it onto this._scope.projects and set index:
|
||||
// Push it onto this._scope[this._list] and set _index:
|
||||
this._index = this._scope[this._list].push(this) - 1;
|
||||
// If the project has no active reference, activate this one
|
||||
if (activate || !this._scope[this._reference])
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// Add PaperScript and Numerical to exports, inject all exports into PaperScope,
|
||||
// and create the initial paper object, all in one condensed statement:
|
||||
var paper = new (PaperScope.inject(Base.exports.inject({
|
||||
paper = new (PaperScope.inject(Base.exports.inject({
|
||||
PaperScript: PaperScript,
|
||||
Numerical: Numerical
|
||||
})))();
|
||||
|
|
|
@ -2915,6 +2915,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
|||
// Otherwise just set the globalAlpha before drawing the
|
||||
// temporary canvas on the parent canvas.
|
||||
parentCtx.save();
|
||||
// Reset transformations, since we're blitting and pixel
|
||||
// scale and with a given offset.
|
||||
parentCtx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
parentCtx.globalAlpha = this._opacity;
|
||||
parentCtx.drawImage(ctx.canvas, itemOffset.x, itemOffset.y);
|
||||
parentCtx.restore();
|
||||
|
|
Loading…
Reference in a new issue