abcjs icon indicating copy to clipboard operation
abcjs copied to clipboard

clef change before bar line causes bar misalignment (grand staff using `%%score {R|L}`)

Open AGBrown opened this issue 6 months ago • 1 comments

Environment:

  • abcjs 6.4.1
  • tested on and occurs in both chrome (127.0.6533.120 (Official Build) (64-bit) (cohort: Stable) ) and firefox (Version 129.0.1, Build ID 20240812083845)

Issue:

If you change the clef on a grand staff, just before the bar line, it causes the bars to be misaligned, this is on a grand staff by using %%score {R|L}

(expand for test abc).

%abc-2.1

X:0
T:Clef change test
%%barnumbers 1
%%measurenb 0
%%score {R|L}
%%stretchlast 1
Q:"Misterioso" 1/4=80
M:2/4
L:1/4
V:R clef=treble
V:L clef=bass
K:Gmaj
[V:R] x x/ G/ | G2 | G2 | G2 |
[V:L] x x/ z/ | C2 | C2 | C2 |
%
%%vskip 40
[V:R] G2 | G2 | G2 | G2 |
[V:L] C2 | C2 | C2 [K:clef=treble] | C2 |
%
%%vskip 40
[V:R] G2 | G2 | G2 | G2 |]
[V:L] C2 | C2 | C2 | C2 |]

Expected output

The bar lines should be aligned immediately after the clef change. See the following example render.

(e.g. from abc2svg ):

(expand for image of expected render).

image

Actual output

The bar lines are misaligned immediately after the clef change:

(expand for image of actual render).

image

Additional notes

  • Although the bar lines are misaligned, the first notes of the following bar are aligned.
  • Using y space on the top stave above the clef change doesn't help
  • This also displays the #1041 issue.

AGBrown avatar Aug 18 '24 23:08 AGBrown