-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Annotation placement #1265
Comments
To me it looks like |
@sschmidTU there is also a horizontalJustification in annotation, that is the downside. So then we'd have position and justification. So it's confusing either way, I will defer to the will of the community. I am leaning towards using the justifications, and warn if someone calls setPosition since it has no effect. If someone calls setPosition with one of the horizontal parameters, we can set the horizontalJustification and likewise with the vertical. I had the same issue with chordSymbol, and I went with using the justification parameters, and ignoring position altogether. So chord symbol and annotation would be somewhat consistent in this way. In an ideal world, we'd have horizontal and vertical position in Modifier, maybe. A single position parameter makes more sense for modifiers that already have some rules for how they relate to the notehead, like ornaments and articulation. But since annotations can be almost anything, you need 2 parameters. |
This is a very hard problem (Finale made solving it their main release feature about 5 years ago, and Dorico made the fact that they had solved it one of their main selling points). I would definitely not try to get this into v4 before a release there. |
@mscuthbert which problem are you referring to? My mission for this issue is just to keep the vertically stacked modifiers from running into each other. This seems pretty do-able, since most modifiers handle this correctly already. |
Modifiers treat top_text_line or text_line inconsistently. Usually it is treated with regard to the note, but I think all the modifiers that are vertically placed should treat the vertical |
fix #1265: Fix issues with vertical placement of annotations
I found this issue while investigating vertical formatting, #411. There are several problems in this issue so I am trying to address them one at a time. This is about the annotations, which do some crazy stuff. TL;DR: annotation Y placement is incorrect and will take some mildly breaking changes to fix.
Here is an example of some placements as the current code does them. The text 'topa' means 'top justification, above position' - see below for what that means.
ModifierPosition
, eitherABOVE
, or...not above, which is treated like below even though there are horizontal values. Based on above or below, it acts like other modifiers and calculates its line position and reports to the formatter how much line space it takes up. Aside from the issue of the parameter, the calculation seems to be almost correct.VerticalJustify
parameter. It uses the line value calculated in the formatter based on position, but then applies it to a direction based on the vertical justify. This could lead to many combinations of things happening depending on how justification or placement are mixed.Based on all this, I think we can do the following:
VerticalJustification
and notModifierPosition
when calculating Y for both rendering and drawing. Only one parameter should specify Y placement, and since it could be a breaking change either way, I think it makes sense to keep the annotation-specific parameter. Even though it's not really 'justification' but placement (vertical justification would justify horizontal text on a vertical axis, which is not what we're doing here). I guess the intent is justifying relative to the note.The text was updated successfully, but these errors were encountered: