In version 1.3 some bar Multi-Track Grace Notes not aligning right beside note #1092
-
the erro happen When Show two tracks at the same time Starting from Bar 31 Some are right, some are not,Cause unknown the erro like this img it's gp file |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I found Cancel the following line of code and it will be normal,But it may cause new bugs. src\rendering\glyphs\VoiceContainerGlyph.ts55 // let graceTargetPreBeat = this.renderer.layoutingInfo.springs.get(graceDisplayStart)!.preBeatWidth;
|
Beta Was this translation helpful? Give feedback.
-
I would say currently it is a mix of "by-design" from the layout algorithm and a bit a left-over from previous grace note positioning. Generally the glyphs before note heads are aligned to not have overlaps because certain glyphs are expected to be at the same horizontal place when they are on all staves. As you indicate: just moving things left/right will rather cause other bugs. I agree that the positioning is not looking good, but it is also not necessarily wrong. Can you provide your test file so I can add an issue for improving the positioning logic? Generally I think it should be not a big deal to position grace notes "as close to the note as possible" but do avoid bugs quite some potential offsets and glyph sizes have to be considered to avoid overlaps in case they exist. The technical details behind the algorithm are: Grace notes always have been a bit of a pain in positioning due to their timely nature of stealing their play time from the previous beat or the next beat. In one of the previous releases we changed the placement of grace notes to "stick" to the next note always and reserve space accodingly. A proper solution/improvement for your reported problem would need: Remembering the actually needed space on the staves for the pre-beat glyphs and then use this width to shift over the grace notes instead of the "shared reserved space" which might be unused. Edit: |
Beta Was this translation helpful? Give feedback.
-
I made some optimization in #1093 |
Beta Was this translation helpful? Give feedback.
I made some optimization in #1093
You can see the new positioning of my example here: https://github.com/CoderLine/alphaTab/blob/develop/test-data/visual-tests/special-notes/grace-notes-alignment.png