Skip to content

Commit

Permalink
Fix another regression in path fields (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
MewPurPur authored May 30, 2024
1 parent d3a3a77 commit b98c6ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
17 changes: 10 additions & 7 deletions src/ui_elements/pathdata_field.gd
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func update_value(new_value: float, property: String, idx: int) -> void:

func _on_relative_button_pressed() -> void:
attribute.toggle_relative_command(hovered_idx)
reactivate_hovered()


# Path commands editor orchestration.
Expand Down Expand Up @@ -215,10 +216,8 @@ func commands_draw() -> void:
var stylebox := StyleBoxFlat.new()
stylebox.set_corner_radius_all(3)
if selected:
if hovered:
stylebox.bg_color = Color(0.7, 0.7, 1.0, 0.18)
else:
stylebox.bg_color = Color(0.6, 0.6, 1.0, 0.16)
stylebox.bg_color = Color(0.7, 0.7, 1.0, 0.18) if hovered else\
Color(0.6, 0.6, 1.0, 0.16)
else:
stylebox.bg_color = Color(0.8, 0.8, 1.0, 0.05)
stylebox.draw(ci, Rect2(Vector2(0, v_offset), Vector2(commands_container.size.x,
Expand Down Expand Up @@ -298,9 +297,13 @@ path_command: PathCommand) -> void:


func activate_hovered(idx: int) -> void:
if idx == hovered_idx or idx >= attribute.get_command_count():
return

if idx != hovered_idx and idx < attribute.get_command_count():
activate_hovered_shared_logic(idx)

func reactivate_hovered() -> void:
activate_hovered_shared_logic(hovered_idx)

func activate_hovered_shared_logic(idx: int) -> void:
if is_instance_valid(hovered_strip):
hovered_strip.queue_free()
if focused_idx != idx:
Expand Down
2 changes: 1 addition & 1 deletion visual/icons/foreign_logos/GithubLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b98c6ae

Please sign in to comment.