Skip to content

Bug: bottom beam height is not correctly calculated #5

@EpsilonD3lta

Description

@EpsilonD3lta

Consider system

M:4/4
L:1/4
V:1
V:2 clef=bass
K:C
[V:1] z1/2z1/2z1/2[EAC]1/2[EF]1/2[EF]1/2z |
[V:2] z1/2z1/2z1/2[E,A,C]1/2[G,A,]1/2[G,A,]1/2z|

Result:
image

If I change

stemHeight = Mathf.Abs(stemHeight - stemPos.y);

to

else if (beam.stemHeight != Beam.unspecifiedStemHeight)
{
    // beam contains notes at different heights, used the calculated stem height
    stemHeight = Mathf.Abs(stemHeight);
}

then it changes to
image
Not sure if the Mathf.Abs is needed there anymore. Also, simple notes do not seem to have this problem. I tested various systems after this change and it seems to work correctly now (although bottom stems are tiny bit longer).
I am not going to create PR because I have too many modifications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions