add remove point

This commit is contained in:
2025-07-09 09:33:26 +02:00
parent 4d31708481
commit bf2266955b
2 changed files with 23 additions and 1 deletions

View File

@@ -57,6 +57,7 @@ enum Message {
LengthChange(String),
ChangeDelta(f32),
AddPoint,
RemovePoint,
}
struct MyApp {
@@ -173,6 +174,9 @@ impl MyApp {
Message::AddPoint => {
self.music.add_point(self.current_delta);
}
Message::RemovePoint => {
self.music.remove_point(self.current_delta);
}
}
}
@@ -315,7 +319,8 @@ impl MyApp {
delta_to_string(self.music.length)
))
.size(20.0),
button("Add Point").on_press(Message::AddPoint)
button("Add Point").on_press(Message::AddPoint),
button("Remove Point").on_press(Message::RemovePoint),
]
.spacing(20),
column![