mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Fixed float edit problem when max <= min
This commit is contained in:
parent
4d90c20493
commit
2e97888437
@ -40,8 +40,11 @@ func set_step(v : float) -> void:
|
||||
func do_update(update_text : bool = true) -> void:
|
||||
if update_text:
|
||||
text = str(value)
|
||||
if cursor != null:
|
||||
cursor.rect_position.x = (clamp(value, min_value, max_value)-min_value)*(slider.rect_size.x-cursor.rect_size.x)/(max_value-min_value)
|
||||
if cursor != null:
|
||||
if max_value != min_value:
|
||||
cursor.rect_position.x = (clamp(value, min_value, max_value)-min_value)*(slider.rect_size.x-cursor.rect_size.x)/(max_value-min_value)
|
||||
else:
|
||||
cursor.rect_position.x = 0
|
||||
|
||||
func _on_LineEdit_gui_input(event : InputEvent) -> void:
|
||||
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
|
||||
|
Loading…
Reference in New Issue
Block a user