add remove point
This commit is contained in:
@@ -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![
|
||||
|
||||
Reference in New Issue
Block a user