@@ -157,18 +157,12 @@ void View::DrawHarmString(DeviceContext *dc, const std::u32string &str, TextDraw
157157 assert (dc);
158158 assert (dc->HasFont ());
159159
160- int toDcX = this ->ToDeviceContextX (params.m_x );
161- int toDcY = this ->ToDeviceContextY (params.m_y );
162-
163160 size_t prevPos = 0 , pos;
164161 while ((pos = str.find_first_of (VRV_TEXT_HARM , prevPos)) != std::wstring::npos) {
165162 // If pos is > than the previous, it is the substring to extract
166163 if (pos > prevPos) {
167164 std::u32string substr = str.substr (prevPos, pos - prevPos);
168- dc->DrawText (UTF32to8 (substr), substr, toDcX, toDcY);
169- // Once we have rendered the some text to not pass x / y anymore
170- toDcX = VRV_UNSET ;
171- toDcY = VRV_UNSET ;
165+ dc->DrawText (UTF32to8 (substr), substr);
172166 }
173167
174168 // if it is the same or we still have space, it is the accidental
@@ -201,23 +195,19 @@ void View::DrawHarmString(DeviceContext *dc, const std::u32string &str, TextDraw
201195 bool isFallbackNeeded = (m_doc->GetResources ()).IsSmuflFallbackNeeded (smuflAccid);
202196 vrvTxt.SetSmuflWithFallback (isFallbackNeeded);
203197 dc->SetFont (&vrvTxt);
204- // Once we have rendered the some text to not pass x / y anymore
205- dc->DrawText (UTF32to8 (smuflAccid), smuflAccid, toDcX, toDcY);
198+ dc->DrawText (UTF32to8 (smuflAccid), smuflAccid);
206199 dc->ResetFont ();
207- toDcX = VRV_UNSET ;
208- toDcY = VRV_UNSET ;
209200 }
210201 // Skip the accidental and continue
211202 prevPos = pos + 1 ;
212203 }
213204 // Print the remainder of the string, or the full string if no accid
214205 if (prevPos < str.length ()) {
215206 std::u32string substr = str.substr (prevPos, std::wstring::npos);
216- dc->DrawText (UTF32to8 (substr), substr, toDcX, toDcY );
207+ dc->DrawText (UTF32to8 (substr), substr);
217208 }
218209
219- // Disable x for what is coming next as child of <f>
220- // The value is reset in DrawFb
210+ // Continue subsequent harmony children in the current text run.
221211 params.m_x = VRV_UNSET ;
222212}
223213
0 commit comments