mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Implement Segment#transform()
This commit is contained in:
parent
847060e146
commit
7ace275da8
1 changed files with 10 additions and 0 deletions
|
@ -477,6 +477,16 @@ var Segment = Base.extend(/** @lends Segment# */{
|
|||
return '{ ' + parts.join(', ') + ' }';
|
||||
},
|
||||
|
||||
/**
|
||||
* Transform the segment by the specified matrix.
|
||||
*
|
||||
* @param {Matrix} matrix the matrix to transform the segment by
|
||||
*/
|
||||
transform: function(matrix) {
|
||||
this._transformCoordinates(matrix, new Array(6), true);
|
||||
this._changed();
|
||||
},
|
||||
|
||||
_transformCoordinates: function(matrix, coords, change) {
|
||||
// Use matrix.transform version() that takes arrays of multiple
|
||||
// points for largely improved performance, as no calls to
|
||||
|
|
Loading…
Reference in a new issue