Vexflow: Tremolo not positioning on note stem UP

Created on 22 Jun 2017  路  4Comments  路  Source: 0xfe/vexflow

Was wondering if anyone has had issues with tremolos not positioning correctly on a note stem? Seems like setPosition() and setYShift() methods on Modifier class which Tremolo extends, is not moving the tremolo at all before it gets drawn.

Im doing it like so, where staveNote is of type vexflow.Flow.StaveNote

addTremoloToNote(staveNote) {
        let tremolo = new vexflow.Flow.Tremolo(1);
        staveNote.addArticulation(0, tremolo);
    }

Renders:

screen shot 2017-06-22 at 12 21 12 pm

When inspecting the object in chrome after using setYShift() on the tremolo, I see that its y_shift value has been modified. But the draw method does not seem to account for it. Also I noticed that the tremolo positions correctly if the stems are facing downward on the stavenote (stem_direction: -1).

bug

All 4 comments

@gciluffo, could you post a fiddle with more of your code? (You can start from the VexFlow Sandbox.) My guess is it has something to do with how you're constructing the beams but I can't see that in the code you've posted. (But I'm also realizing we don't seem to have any Tremolo tests in the test suite.)

@gristow

Okay I made a fiddle here. Just added a couple notes, one with stem up and stem down with tremolos.

Yep, that's a bug for sure. I'm trying to knock out a bunch of little bugs this afternoon, so I'll add this to the list.

the bug remains

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rowild picture rowild  路  5Comments

amitgur picture amitgur  路  4Comments

jeroenlammerts picture jeroenlammerts  路  3Comments

sug1no picture sug1no  路  7Comments

Silverwolf90 picture Silverwolf90  路  4Comments