mirror of https://github.com/odrling/Aegisub
Fix rounding errors that resulted in karaoke syllables drifting
This commit is contained in:
parent
004b41f0eb
commit
9009c963e3
|
@ -40,7 +40,7 @@ wxString AssKaraoke::Syllable::GetText(bool k_tag) const {
|
||||||
wxString ret;
|
wxString ret;
|
||||||
|
|
||||||
if (k_tag)
|
if (k_tag)
|
||||||
ret = wxString::Format("{%s%d}", tag_type, duration / 10);
|
ret = wxString::Format("{%s%d}", tag_type, (duration + 5) / 10);
|
||||||
|
|
||||||
size_t idx = 0;
|
size_t idx = 0;
|
||||||
for (std::map<size_t, wxString>::const_iterator ovr = ovr_tags.begin(); ovr != ovr_tags.end(); ++ovr) {
|
for (std::map<size_t, wxString>::const_iterator ovr = ovr_tags.begin(); ovr != ovr_tags.end(); ++ovr) {
|
||||||
|
|
|
@ -375,7 +375,7 @@ int AudioTimingControllerKaraoke::MoveMarker(KaraokeMarker *marker, int new_posi
|
||||||
marker->Move(new_position);
|
marker->Move(new_position);
|
||||||
|
|
||||||
size_t syl = marker - &markers.front() + 1;
|
size_t syl = marker - &markers.front() + 1;
|
||||||
kara->SetStartTime(syl, new_position);
|
kara->SetStartTime(syl, (new_position + 5) / 10 * 10);
|
||||||
|
|
||||||
labels[syl - 1].range = TimeRange(labels[syl - 1].range.begin(), new_position);
|
labels[syl - 1].range = TimeRange(labels[syl - 1].range.begin(), new_position);
|
||||||
labels[syl].range = TimeRange(new_position, labels[syl].range.end());
|
labels[syl].range = TimeRange(new_position, labels[syl].range.end());
|
||||||
|
|
Loading…
Reference in New Issue