fix: Segmentlöschung für ausgewählte Segmente ergänzen
- eigener Button „Segment löschen“ in der Statusleiste, nur bei Auswahl aktiv - Entf und Backspace löschen das ausgewählte Segment - Abschnitts-Button eindeutig als „Abschnitt löschen“ benannt - Statusleiste zeigt bei Auswahl Richtung und Kante statt der allgemeinen Hilfe - Tests für Lösch-Button, Auswahl-Reset und Deaktivierung ergänzt
This commit is contained in:
parent
5face42141
commit
98eb5b7e2f
4 changed files with 86 additions and 9 deletions
|
|
@ -39,6 +39,10 @@ func _run() -> void:
|
|||
routine != null and _contains_error(routine.validate(), "at least one segment"),
|
||||
"empty draft reports the missing segment"
|
||||
)
|
||||
_check(
|
||||
controller.delete_segment_button.disabled,
|
||||
"segment delete starts disabled without a selection"
|
||||
)
|
||||
|
||||
var first := controller.add_segment(
|
||||
Vector2(-20.0, -5.0),
|
||||
|
|
@ -304,6 +308,10 @@ func _run() -> void:
|
|||
controller.get_selected_segment() == arc_right,
|
||||
"a backward/inside segment can be selected"
|
||||
)
|
||||
_check(
|
||||
not controller.delete_segment_button.disabled,
|
||||
"segment delete is enabled with a selection"
|
||||
)
|
||||
_check(
|
||||
controller.backward_button.button_pressed,
|
||||
"toolbar shows the selected segment direction"
|
||||
|
|
@ -342,6 +350,25 @@ func _run() -> void:
|
|||
"toolbar stays in sync after editing"
|
||||
)
|
||||
|
||||
var count_before_delete := section.segments.size()
|
||||
controller.delete_segment_button.pressed.emit()
|
||||
_check(
|
||||
section.segments.size() == count_before_delete - 1,
|
||||
"segment delete button removes the selected segment"
|
||||
)
|
||||
_check(
|
||||
not section.segments.has(arc_right),
|
||||
"deleted segment is removed from the active section"
|
||||
)
|
||||
_check(
|
||||
controller.get_selected_segment() == null,
|
||||
"deleting a segment clears the selection"
|
||||
)
|
||||
_check(
|
||||
controller.delete_segment_button.disabled,
|
||||
"segment delete disables again after deletion"
|
||||
)
|
||||
|
||||
controller.set_tool(WhiteboardController.Tool.LINE)
|
||||
_check(
|
||||
controller.get_selected_segment() == null,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue