mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Optimise Point#rotate(0)
This commit is contained in:
parent
fe4da8e7a4
commit
a5cdb5492c
1 changed files with 2 additions and 0 deletions
|
@ -621,6 +621,8 @@ var Point = this.Point = Base.extend(/** @lends Point# */{
|
|||
* @returns {Point} the rotated point
|
||||
*/
|
||||
rotate: function(angle, center) {
|
||||
if (angle === 0)
|
||||
return this.clone();
|
||||
angle = angle * Math.PI / 180;
|
||||
var point = center ? this.subtract(center) : this,
|
||||
s = Math.sin(angle),
|
||||
|
|
Loading…
Reference in a new issue