Skip to content

Commit

Permalink
Fix sliders bouncing around. Cause was SIZE_EXPAND
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Jul 1, 2024
1 parent 199629b commit debc074
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions project/addons/terrain_3d/src/tool_settings.gd
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ func add_setting(p_args: Dictionary) -> void:

SettingType.PICKER:
var button := Button.new()
button.set_v_size_flags(SIZE_SHRINK_CENTER)
button.icon = load(PICKER_ICON)
button.tooltip_text = "Pick value from the Terrain"
button.pressed.connect(_on_pick.bind(p_default))
Expand Down Expand Up @@ -398,7 +399,6 @@ func add_setting(p_args: Dictionary) -> void:
spin_slider.set_step(p_step)
spin_slider.set_value(p_default)
spin_slider.set_suffix(p_suffix)
spin_slider.set_h_size_flags(SIZE_SHRINK_CENTER)
spin_slider.set_v_size_flags(SIZE_SHRINK_CENTER)
spin_slider.set_custom_minimum_size(Vector2(75, 0))

Expand All @@ -415,8 +415,6 @@ func add_setting(p_args: Dictionary) -> void:

else: # DOUBLE_SLIDER
var label := Label.new()
label.set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER)
label.set_vertical_alignment(VERTICAL_ALIGNMENT_CENTER)
label.set_custom_minimum_size(Vector2(75, 0))
slider = DoubleSlider.new()
slider.label = label
Expand All @@ -431,7 +429,6 @@ func add_setting(p_args: Dictionary) -> void:
slider.set_step(p_step)
slider.set_value(p_default)
slider.set_v_size_flags(SIZE_SHRINK_CENTER)
slider.set_h_size_flags(SIZE_SHRINK_END | SIZE_EXPAND)
slider.set_custom_minimum_size(Vector2(60, 10))

control.name = p_name.to_pascal_case()
Expand Down

0 comments on commit debc074

Please sign in to comment.