Optimise Point#rotate(0)

This commit is contained in:
Jürg Lehni 2012-11-05 23:23:25 -08:00
parent fe4da8e7a4
commit a5cdb5492c

View file

@ -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),