Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/editors/interface/interface_widgets.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 6b50279d6d3..d745c9b4207 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -3605,7 +3605,13 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
float factor_discard = 1.0f; /* No discard. */
float value = (float)ui_but_value_get(but);
- factor = (value - but->softmin) / (but->softmax - but->softmin);
+ if (but->rnaprop && (RNA_property_subtype(but->rnaprop) == PROP_PERCENTAGE)) {
+ factor = value / but->softmax;
+ }
+ else {
+ factor = (value - but->softmin) / (but->softmax - but->softmin);
+ }
+
factor_ui = factor * (float)BLI_rcti_size_x(rect);
if (factor_ui <= offs) {