From e962e4bfa6c447b5e7019c250a649cd708df1737 Mon Sep 17 00:00:00 2001 From: dovbaeb Date: Mon, 9 Nov 2026 14:14:23 +0100 Subject: [PATCH] slider return correct values --- perlinator.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/perlinator.py b/perlinator.py index efcbc4b..8248d56 100755 --- a/perlinator.py +++ b/perlinator.py @@ -106,19 +106,29 @@ s_slider_double = DoubleVar() def get_sliders(): - return b_slider_double.get(), c_slider_double.get(), s_slider_double.get() + + print( + b_slider_double.get() / 100, + c_slider_double.get() / 100, + s_slider_double.get() / 100, + ) + return ( + b_slider_double.get() / 100, + c_slider_double.get() / 100, + s_slider_double.get() / 100, + ) b_slider_val, c_slider_val, s_slider_val = get_sliders() # 1 to 100 → 0 to 1 -b_slider = Scale(parent, variable=b_slider_double, from_=1, to=100, orient=HORIZONTAL) -c_slider = Scale(parent, variable=c_slider_double, from_=1, to=100, orient=HORIZONTAL) -s_slider = Scale(parent, variable=s_slider_double, from_=1, to=100, orient=HORIZONTAL) +b_slider = Scale(parent, variable=b_slider_double, from_=0, to=100, orient=HORIZONTAL) +c_slider = Scale(parent, variable=c_slider_double, from_=0, to=100, orient=HORIZONTAL) +s_slider = Scale(parent, variable=s_slider_double, from_=0, to=100, orient=HORIZONTAL) show_enhance_button = Button( parent, - text="Apply b", + text="Preview", command=get_sliders, bg="yellow", )