mirror of
https://github.com/Relintai/material-maker.git
synced 2025-01-25 18:59: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:
|
func do_update(update_text : bool = true) -> void:
|
||||||
if update_text:
|
if update_text:
|
||||||
text = str(value)
|
text = str(value)
|
||||||
if cursor != null:
|
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 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:
|
func _on_LineEdit_gui_input(event : InputEvent) -> void:
|
||||||
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
|
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
|
||||||
|
Loading…
Reference in New Issue
Block a user