Skip to content

Commit d3d31e2

Browse files
committed
fix bugs found in musxdom testing:
- get end notehead width from end testing - do not early exit with tie-end index unless it is a tie end
1 parent 3bbd623 commit d3d31e2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/library/tie.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ local calc_tie_length = function(note, tie_mod, for_pageview, direction, tie_pre
720720
if rplacement == finale.TIEPLACE_OVERINNER or rplacement == finale.TIEPLACE_UNDERINNER or rplacement == finale.TIEPLACE_UNDEROUTERSTEM then
721721
incr_end = -INNER_INCREMENT
722722
else
723-
horz_end = horz_end + (entry_metrics_start:GetNoteWidth(note.NoteIndex) * (1.0 - OUTER_NOTE_OFFSET_PCTG))
723+
horz_end = horz_end + (entry_metrics:GetNoteWidth(note_index) * (1.0 - OUTER_NOTE_OFFSET_PCTG))
724724
end
725725
end
726726

@@ -760,15 +760,15 @@ function tie.calc_contour_index(note, tie_mod, for_pageview, direction, tie_pref
760760
end
761761
direction = direction and direction ~= finale.TIEMODDIR_AUTOMATIC and direction or tie.calc_direction(note, tie_mod, tie_prefs)
762762
local tie_placement_prefs = tie_prefs:CreateTiePlacementPrefs()
763-
if tie_prefs.UseTieEndStyle then
763+
if tie_mod and not tie_mod:IsStartTie() and tie_prefs.UseTieEndStyle then
764764
return finale.TCONTOURIDX_TIEENDS
765765
end
766766
local tie_length = calc_tie_length(note, tie_mod, for_pageview, direction, tie_prefs, tie_placement_prefs)
767767
local tie_contour_prefs = tie_prefs:CreateTieContourPrefs()
768768
if tie_length >= tie_contour_prefs:GetSpan(finale.TCONTOURIDX_LONG) then
769-
return finale.TCONTOURIDX_LONG
769+
return finale.TCONTOURIDX_LONG, tie_length
770770
elseif tie_length <= tie_contour_prefs:GetSpan(finale.TCONTOURIDX_SHORT) then
771-
return finale.TCONTOURIDX_SHORT
771+
return finale.TCONTOURIDX_SHORT, tie_length
772772
end
773773
return finale.TCONTOURIDX_MEDIUM, tie_length
774774
end

0 commit comments

Comments
 (0)