Skip to content

Continued ties/slurs on a new system start over the clef instead of after it #2799

Description

@GiovanniSlabs

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When a tie or slur spans a system break, the continuation segment on the new system starts at the very left edge of the staff, drawing the curve across the clef and key signature.

Image

Expected Behavior

The continuation segment should start after the clef, key and time signatures, just before the first note - as done in standard engraving practice (e.g. by

Image

MuseScore or Finale). Mockup of the expected result:

Steps To Reproduce

  1. Render the following alphaTex with a width that forces a line break
    (e.g. 600px). Also reproducible with any MusicXML file where a tie or
    slur crosses a line break.

    C4 {slur S1}
    | r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r| r
    A4 {slur S1}

  2. On the second and following systems the slur segment starts at the left
    border of the staff, overlapping the clef. The same happens with a simple
    two-note tie when the second note falls on a new system.

The existing visual test references show the behavior as well, e.g.
test-data/visual-tests/layout/multi-system-slur-scale-down-1-600.png.

Link to jsFiddle, CodePen, Project

No response

Version and Environment

alphaTab 1.8.4 (npm @coderline/alphatab, web/Vite)
Also reproduced building from source on develop (commit f4aa0f77)
Browser: Chrome on MacOS

Platform

Web

Anything else?

The cause is in TieGlyph: both the final segment (TieGlyph.doLayout, forEnd
branch) and the full-system segments of multi-system slurs
(ContinuationTieGlyph.calculateStartX) anchor the start of the curve at
staff.barRenderers[0].x instead of after the pre-beat glyphs. Anchoring at
barRenderers[0].x + barRenderers[0].beatGlyphsStart fixes it. One caveat:
for ties ending on the first beat of the system the end X coincides with
beatGlyphsStart, so the continuation stub also needs a minimum length
(e.g. 2 staff spaces) to stay visible.

I have a fix ready with updated visual test references and I'm going to open
a PR: https://github.com/GiovanniSlabs/alphaTab/tree/feature/tie-continuation-after-clef

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

Priority

None yet

Area

None yet

Platform

None yet

Work State

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions