Skip to content

Commit 37e0c9b

Browse files
committed
Use double consistently in Range::get_as_ratio.
1 parent 4d1f26e commit 37e0c9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/gui/range.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ double Range::get_as_ratio() const {
272272
if (shared->exp_ratio && get_min() >= 0) {
273273
double exp_min = get_min() == 0 ? 0.0 : Math::log(get_min()) / Math::log((double)2);
274274
double exp_max = Math::log(get_max()) / Math::log((double)2);
275-
float value = CLAMP(get_value(), shared->min, shared->max);
275+
double value = CLAMP(get_value(), shared->min, shared->max);
276276
double v = Math::log(value) / Math::log((double)2);
277277

278278
return CLAMP((v - exp_min) / (exp_max - exp_min), 0, 1);
279279
} else {
280-
float value = CLAMP(get_value(), shared->min, shared->max);
280+
double value = CLAMP(get_value(), shared->min, shared->max);
281281
return CLAMP((value - get_min()) / (get_max() - get_min()), 0, 1);
282282
}
283283
}

0 commit comments

Comments
 (0)