opensheetmusicdisplay: Problem with stem colors after a transparent rendering.

In the #1 image below I am rendering a score with transparent notes and stems. (To make the problem easier to see I have made them red, rather than transparent in this image.)

In all three renderings, I am using the same code to set options.

osmd.setOptions({
   
        defaultColorNotehead: drawing_color,
        defaultColorStem: drawing_color,
        defaultColorRest: rest_color,
        
        coloringEnabled: coloring_enabled,
        colorStemsLikeNoteheads: 1,
        defaultFontFamily: "Ariel Bold",

        drawFromMeasureNumber: start_measure,
        drawUpToMeasureNumber: end_measure + 1,

    });

For #1, drawing_color is set to #ff0000 and coloring enabled is set to 1:

       drawing_color: #ff0000,
        rest_color: #ff0000
        coloring_enabled: 1
        start_measure: 1
        end_measure: 36

For #2 and #3 I am setting these values:

drawing_color: #000000,
        rest_color: #00000000
        coloring_enabled: 0
        start_measure: 1
        end_measure: 3

(Ignore the transparent rest color, it is not used because coloring_enabled is set to 0)

In all three cases colorStemsLikeNoteheads is set to 1, but it doesn’t work in the #2 rendering, until it is re-rendered in #3

All rendering are made by pressing a button on the screen, and with their own new osmd. So this is probably not a timing issue, but rather an issue of the stem colors set with colorins_enabled in #1 carrying over into #2, but then being set properly when it is re-rendered with #3.

image

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (5 by maintainers)

Commits related to this issue

Most upvoted comments

I did build a new test.htm for this. It seems to be working properly now.

Thanks for your help. You can close this issue if you like.