Skip to content

Commit

Permalink
Merge pull request #695 from henryso/fix-693
Browse files Browse the repository at this point in the history
Fixed incorrect detection of note-in-same-glyph for episema height adjustment.
  • Loading branch information
eroux committed Dec 8, 2015
2 parents 348e979 + 381e9e7 commit 40c063a
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/gregoriotex/gregoriotex-position.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,15 +1117,25 @@ static __inline void end_h_episema(height_computation *const h,
h->height = proposed_height;
}
}
/* end->previous checks that it's within the same glyph */
if (end && end->type == GRE_NOTE && end->previous
&& end->previous->type == GRE_NOTE
&& is_connected_left(h->get_size(end))
&& !has_space_to_left(end) && h->last_connected_note
&& is_connected_right(h->get_size(h->last_connected_note))) {
proposed_height = end->u.note.pitch + h->vpos;
if (h->is_better_height(proposed_height, h->height)) {
h->height = proposed_height;
if (end && end->type == GRE_NOTE) {
gregorio_note *note;
/* this loop checks that it's within the same glyph */
for (note = end->previous; note; note = note->previous) {
if (note == h->start_note) {
if (is_connected_left(h->get_size(end))
&& h->last_connected_note
&& h->last_connected_note->next
&& h->last_connected_note->next->type == GRE_NOTE
&& !has_space_to_left(h->last_connected_note->next)
&& is_connected_right(h->get_size(
h->last_connected_note))) {
proposed_height = end->u.note.pitch + h->vpos;
if (h->is_better_height(proposed_height, h->height)) {
h->height = proposed_height;
}
}
break;
}
}
}

Expand Down

0 comments on commit 40c063a

Please sign in to comment.