mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -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
|
* @returns {Point} the rotated point
|
||||||
*/
|
*/
|
||||||
rotate: function(angle, center) {
|
rotate: function(angle, center) {
|
||||||
|
if (angle === 0)
|
||||||
|
return this.clone();
|
||||||
angle = angle * Math.PI / 180;
|
angle = angle * Math.PI / 180;
|
||||||
var point = center ? this.subtract(center) : this,
|
var point = center ? this.subtract(center) : this,
|
||||||
s = Math.sin(angle),
|
s = Math.sin(angle),
|
||||||
|
|
Loading…
Reference in a new issue