From 2452aa8e88a67f448040563eb890d624ce8c101c Mon Sep 17 00:00:00 2001 From: Vicnet Date: Mon, 7 Oct 2013 13:03:00 +0200 Subject: factorize Value::RangeType method 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 #include +#include // 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; -- cgit v0.10.1