summaryrefslogtreecommitdiff
path: root/src/value.h
diff options
context:
space:
mode:
authorVicnet <vo.publique@gmail.com>2013-10-07 11:03:00 (GMT)
committerVicnet <vo.publique@gmail.com>2013-10-07 14:04:42 (GMT)
commit2452aa8e88a67f448040563eb890d624ce8c101c (patch)
treed5db242c1db45e33a4381d3e7eb16b8130a35de0 /src/value.h
parent3dfb76a56d2cc38bda988eeb2cdf51ccbfb4df15 (diff)
factorize Value::RangeType method
Diffstat (limited to 'src/value.h')
-rw-r--r--src/value.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/value.h b/src/value.h
index f9bd99b..4d8346f 100644
--- a/src/value.h
+++ b/src/value.h
@@ -3,6 +3,7 @@
#include <vector>
#include <string>
+#include <algorithm>
// Workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
#ifndef Q_MOC_RUN
@@ -39,6 +40,13 @@ public:
this->end == other.end;
}
+ /// inverse begin/end if begin is upper than end
+ void normalize() {
+ if (end < begin) {
+ std::swap(begin,end);
+ }
+ }
+
double begin;
double step;
double end;
contact: Jan Huwald // Impressum