Skip to content
Extraits de code Groupes Projets
Valider de862cb6 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Remove the correct syllable split on a click on the left side of the split line

parent 5cdcd3dc
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -315,9 +315,9 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) { ...@@ -315,9 +315,9 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) {
// If the click is sufficiently close to a line of a syllable split, // If the click is sufficiently close to a line of a syllable split,
// remove that split rather than adding a new one // remove that split rather than adding a new one
click_will_remove_split = bool click_right = (syl > 0 && shifted_pos <= syl_lines[syl - 1] + 3);
(syl > 0 && shifted_pos <= syl_lines[syl - 1] + 3) || bool click_left = (syl < (int)syl_lines.size() && shifted_pos >= syl_lines[syl] - 3);
(syl < (int)syl_lines.size() && shifted_pos >= syl_lines[syl] - 3); click_will_remove_split = click_left || click_right;
if (!event.LeftDown()) { if (!event.LeftDown()) {
// Erase the old line and draw the new one // Erase the old line and draw the new one
...@@ -326,7 +326,7 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) { ...@@ -326,7 +326,7 @@ void AudioKaraoke::OnMouse(wxMouseEvent &event) {
} }
if (click_will_remove_split) { if (click_will_remove_split) {
kara->RemoveSplit(syl); kara->RemoveSplit(syl + (click_left && !click_right));
} }
else { else {
kara->AddSplit(syl, split_pos - syl_start_points[syl]); kara->AddSplit(syl, split_pos - syl_start_points[syl]);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter