[PATCH 2 of 4] Dont assume that wqdays are always of none zero length
Wald Commits
scm-commit at wald.intevation.org
Thu Oct 31 18:34:16 CET 2013
# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1383240409 -3600
# Node ID f206f6049b2bdae9f73ce8a3f92f35082b4cf54a
# Parent f8e1af4e2f690fdb3a7b80411481dfaca8e4a57f
Dont assume that wqdays are always of none zero length.
diff -r f8e1af4e2f69 -r f206f6049b2b artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java Thu Oct 31 18:25:26 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java Thu Oct 31 18:26:49 2013 +0100
@@ -58,6 +58,11 @@
* Employ linear interpolation.
*/
protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) {
+
+ if (wqday.size() == 0) {
+ return;
+ }
+
int idx = 0;
float q = annotation.getPos();
boolean qIncreases = wqday.getQ(0) < wqday.getQ(wqday.size()-1);
diff -r f8e1af4e2f69 -r f206f6049b2b artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java Thu Oct 31 18:25:26 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java Thu Oct 31 18:26:49 2013 +0100
@@ -54,6 +54,11 @@
* Employ linear interpolation.
*/
protected static void setHitPoint(WQDay wqday, StickyAxisAnnotation annotation) {
+
+ if (wqday.size() == 0) {
+ return;
+ }
+
int idx = 0;
float w = annotation.getPos();
boolean wIncreases = wqday.getW(0) < wqday.getW(wqday.size()-1);
More information about the Dive4elements-commits
mailing list