diff --git a/OpenUtau/ViewModels/NotesViewModelHitTest.cs b/OpenUtau/ViewModels/NotesViewModelHitTest.cs index bf634641a..85fcb5f8b 100644 --- a/OpenUtau/ViewModels/NotesViewModelHitTest.cs +++ b/OpenUtau/ViewModels/NotesViewModelHitTest.cs @@ -267,7 +267,9 @@ public PitchPointHitInfo HitTestPitchPoint(Point point) { return null; } double tick = viewModel.PointToTick(point); - var phrase = viewModel.Part.renderPhrases.FirstOrDefault(p => p.end >= tick); + double absTick = tick + viewModel.Part.position; + + var phrase = viewModel.Part.renderPhrases.FirstOrDefault(p => p.end >= absTick); if (phrase == null) { phrase = viewModel.Part.renderPhrases.Last(); } @@ -275,7 +277,8 @@ public PitchPointHitInfo HitTestPitchPoint(Point point) { return null; } var curve = phrase.pitchesBeforeDeviation; - var pitchIndex = (int)Math.Round((tick - phrase.position + phrase.leading) / 5); + int phraseStartRel = phrase.position - viewModel.Part.position; + var pitchIndex = (int)Math.Round((tick - phraseStartRel + phrase.leading) / 5.0); pitchIndex = Math.Clamp(pitchIndex, 0, curve.Length - 1); return curve[pitchIndex]; }