[PATCH] (issue1788) Do not divide area by two

Wald Commits scm-commit at wald.intevation.org
Wed Feb 18 17:17:40 CET 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1424276240 -3600
# Node ID 4dd6d89ce95eee55403e2bb9b1872c693bca0a11
# Parent  4ead7919e709108cbddad778c7a9a2cb0f0af960
(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.

diff -r 4ead7919e709 -r 4dd6d89ce95e artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java
--- a/artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java	Wed Feb 18 16:57:58 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/jfree/StableXYDifferenceRenderer.java	Wed Feb 18 17:17:20 2015 +0100
@@ -1640,7 +1640,7 @@
         Object[] l_xValues = x_xValues.toArray();
         Object[] l_yValues = x_yValues.toArray();
 
-        double area = calculateArea(l_xValues, l_yValues)/2d;
+        double area = calculateArea(l_xValues, l_yValues);
         if (x_positive) positiveArea += area;
         else            negativeArea += area;
         updateCentroid(l_xValues, l_yValues);


More information about the Dive4Elements-commits mailing list