From 269bdb451be6f6bd3f1b2f3f50a105830c608e26 Mon Sep 17 00:00:00 2001 From: MewPurPur Date: Tue, 14 May 2024 22:10:37 +0300 Subject: [PATCH] Remove a bit of pause-related logic --- src/data_classes/TagLine.gd | 2 +- src/data_classes/TagRect.gd | 2 +- src/ui_elements/BetterLineEdit.gd | 2 -- src/ui_elements/pathdata_field.gd | 3 +-- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/data_classes/TagLine.gd b/src/data_classes/TagLine.gd index 57c7b8ec..bde59192 100644 --- a/src/data_classes/TagLine.gd +++ b/src/data_classes/TagLine.gd @@ -8,7 +8,7 @@ const icon = preload("res://visual/icons/tag/line.svg") const known_attributes = ["transform", "opacity", "stroke", "stroke-opacity", "stroke-width", "stroke-linecap", "x1", "y1", "x2", "y2", ] -func _init(pos := Vector2.ZERO) -> void: +func _init() -> void: for attrib_name in known_attributes: attributes[attrib_name] = DB.attribute(attrib_name) super() diff --git a/src/data_classes/TagRect.gd b/src/data_classes/TagRect.gd index 18d761dc..754db6a4 100644 --- a/src/data_classes/TagRect.gd +++ b/src/data_classes/TagRect.gd @@ -9,7 +9,7 @@ const known_attributes = ["transform", "opacity", "fill", "fill-opacity", "stroke", "stroke-opacity", "stroke-width", "stroke-linejoin", "x", "y", "width", "height", "rx", "ry",] -func _init(pos := Vector2.ZERO) -> void: +func _init() -> void: for attrib_name in known_attributes: attributes[attrib_name] = DB.attribute(attrib_name) super() diff --git a/src/ui_elements/BetterLineEdit.gd b/src/ui_elements/BetterLineEdit.gd index 7e54219c..66be4252 100644 --- a/src/ui_elements/BetterLineEdit.gd +++ b/src/ui_elements/BetterLineEdit.gd @@ -49,12 +49,10 @@ var first_click := false var text_before_focus := "" func _on_base_class_focus_entered() -> void: - process_mode = PROCESS_MODE_ALWAYS first_click = true text_before_focus = text func _on_base_class_focus_exited() -> void: - process_mode = PROCESS_MODE_INHERIT first_click = false if Input.is_action_pressed("ui_cancel"): text = text_before_focus diff --git a/src/ui_elements/pathdata_field.gd b/src/ui_elements/pathdata_field.gd index 5b936a04..6b4e8517 100644 --- a/src/ui_elements/pathdata_field.gd +++ b/src/ui_elements/pathdata_field.gd @@ -120,8 +120,7 @@ func _on_commands_mouse_exited() -> void: for field in fields: if field.has_focus(): active_idx = cmd_idx - # Should switch out the controls for fake outs. This is safe even when - # you've focused a BetterLineEdit, because it pauses the tree. + # Should switch out the controls for fake outs. if active_idx != cmd_idx: fields = [] deactivate()