mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Simplify Point#getDirectedAngle().
This commit is contained in:
parent
ab634f2391
commit
2b5e9296f7
1 changed files with 1 additions and 7 deletions
|
@ -273,13 +273,7 @@ var Point = this.Point = Base.extend({
|
|||
getDirectedAngle: function(point) {
|
||||
point = Point.read(arguments);
|
||||
var angle = this.getAngle() - point.getAngle();
|
||||
var bounds = 180;
|
||||
if (angle < - bounds) {
|
||||
return angle + bounds * 2;
|
||||
} else if (angle > bounds) {
|
||||
return angle - bounds * 2;
|
||||
}
|
||||
return angle;
|
||||
return angle < -180 ? angle + 360 : angle > 180 ? angle - 360 : angle;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue