Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java @ 8530:4dd6d89ce95e
(issue1788) Do not divide area by two.
The area calcluation correctly calculates the area of a polygon
to divide it by two breaks that result.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 18 Feb 2015 17:17:20 +0100 |
parents | 432addd00687 |
children | 36d7bda0b47a |
comparison
equal
deleted
inserted
replaced
8529:4ead7919e709 | 8530:4dd6d89ce95e |
---|---|
1638 RectangleEdge l_rangeAxisLocation = x_plot.getRangeAxisEdge(); | 1638 RectangleEdge l_rangeAxisLocation = x_plot.getRangeAxisEdge(); |
1639 | 1639 |
1640 Object[] l_xValues = x_xValues.toArray(); | 1640 Object[] l_xValues = x_xValues.toArray(); |
1641 Object[] l_yValues = x_yValues.toArray(); | 1641 Object[] l_yValues = x_yValues.toArray(); |
1642 | 1642 |
1643 double area = calculateArea(l_xValues, l_yValues)/2d; | 1643 double area = calculateArea(l_xValues, l_yValues); |
1644 if (x_positive) positiveArea += area; | 1644 if (x_positive) positiveArea += area; |
1645 else negativeArea += area; | 1645 else negativeArea += area; |
1646 updateCentroid(l_xValues, l_yValues); | 1646 updateCentroid(l_xValues, l_yValues); |
1647 | 1647 |
1648 GeneralPath l_path = new GeneralPath(); | 1648 GeneralPath l_path = new GeneralPath(); |