mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Only transform canvas if matrix is not the identity.
This commit is contained in:
parent
7969e4647c
commit
56869baaad
1 changed files with 4 additions and 1 deletions
|
@ -757,7 +757,10 @@ var Matrix = Base.extend(/** @lends Matrix# */{
|
||||||
* @param {CanvasRenderingContext2D} ctx
|
* @param {CanvasRenderingContext2D} ctx
|
||||||
*/
|
*/
|
||||||
applyToContext: function(ctx) {
|
applyToContext: function(ctx) {
|
||||||
ctx.transform(this._a, this._c, this._b, this._d, this._tx, this._ty);
|
if (!this.isIdentity()) {
|
||||||
|
ctx.transform(this._a, this._c, this._b, this._d,
|
||||||
|
this._tx, this._ty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, Base.each(['a', 'c', 'b', 'd', 'tx', 'ty'], function(name) {
|
}, Base.each(['a', 'c', 'b', 'd', 'tx', 'ty'], function(name) {
|
||||||
// Create getters and setters for all internal attributes.
|
// Create getters and setters for all internal attributes.
|
||||||
|
|
Loading…
Reference in a new issue