Skip to content

Commit

Permalink
Simplify Path#getArea()
Browse files Browse the repository at this point in the history
Relates to paperjs#994
  • Loading branch information
lehni committed Feb 26, 2016
1 parent 1db419a commit 7dd110f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/path/Curve.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,12 +761,9 @@ statics: /** @lends Curve */{
c1x = v[2], c1y = v[3],
c2x = v[4], c2y = v[5],
p2x = v[6], p2y = v[7];
return (3.0 * c1y * p1x - 1.5 * c1y * c2x
- 1.5 * c1y * p2x - 3.0 * p1y * c1x
- 1.5 * p1y * c2x - 0.5 * p1y * p2x
+ 1.5 * c2y * p1x + 1.5 * c2y * c1x
- 3.0 * c2y * p2x + 0.5 * p2y * p1x
+ 1.5 * p2y * c1x + 3.0 * p2y * c2x) / 10;
return (6 * (p1x*c1y-p1y*c1x+c2x*p2y-p2x*c2y) +
3 * (c1x*p2y-c1y*p2x+p1x*c2y-c2x*p1y+c1x*c2y-c1y*c2x) +
1 * (p1x*p2y-p1y*p2x)) / 20;
},

getBounds: function(v) {
Expand Down

0 comments on commit 7dd110f

Please sign in to comment.