mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Fix odd issue of Rasters rotating the wrong way, which seems to be caused by Canvas not using the same Matrix orientation as Paper.js (scaleX (m00) and scaleY (m11) need to be flipped).
This commit is contained in:
parent
700f4aeb6a
commit
763fc95776
1 changed files with 5 additions and 2 deletions
|
@ -455,9 +455,12 @@ var Matrix = Base.extend({
|
|||
* Applies this matrix to the specified Canvas Context.
|
||||
*/
|
||||
applyToContext: function(context) {
|
||||
// Canvas contexts seem to use another orientation: The scaleX (m00) and
|
||||
// scaleY (m11) values need to be flipped to get correct behaviour e.g.
|
||||
// when using rotation or shearing.
|
||||
context.setTransform(
|
||||
this._m00, this._m01, this._m10,
|
||||
this._m11, this._m02, this._m12
|
||||
-this._m00, this._m01, this._m10,
|
||||
-this._m11, this._m02, this._m12
|
||||
);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue