summaryrefslogtreecommitdiffstats
path: root/scene/gui/range.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2018-05-15 17:12:35 -0300
committerJuan Linietsky <reduzio@gmail.com>2018-05-15 17:14:31 -0300
commit005b69cf6e276209464cc8c36ebc7376679925b6 (patch)
tree2271a91a727cb9afcc2f58b4b91023f4a0a7f7f8 /scene/gui/range.cpp
parent3b8bd50b41e0197ab3bce653548715872a93ea80 (diff)
downloadredot-engine-005b69cf6e276209464cc8c36ebc7376679925b6.tar.gz
-New inspector.
-Changed UI resizing code, gained huge amount of speed. -Reorganized timer sync to clean up behavior (sorry forgot commit this before) -
Diffstat (limited to 'scene/gui/range.cpp')
-rw-r--r--scene/gui/range.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index cd6c6bb65c..caafda2c65 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -136,9 +136,9 @@ void Range::set_as_ratio(double p_value) {
double v;
- if (shared->exp_ratio && get_min() > 0) {
+ if (shared->exp_ratio && get_min() >= 0) {
- double exp_min = Math::log(get_min()) / Math::log((double)2);
+ double exp_min = get_min() == 0 ? 0.0 : Math::log(get_min()) / Math::log((double)2);
double exp_max = Math::log(get_max()) / Math::log((double)2);
v = Math::pow(2, exp_min + (exp_max - exp_min) * p_value);
} else {
@@ -155,9 +155,9 @@ void Range::set_as_ratio(double p_value) {
}
double Range::get_as_ratio() const {
- if (shared->exp_ratio && get_min() > 0) {
+ if (shared->exp_ratio && get_min() >= 0) {
- double exp_min = Math::log(get_min()) / Math::log((double)2);
+ double exp_min = get_min() == 0 ? 0.0 : Math::log(get_min()) / Math::log((double)2);
double exp_max = Math::log(get_max()) / Math::log((double)2);
double v = Math::log(get_value()) / Math::log((double)2);