@@ -116,25 +116,28 @@ struct ChordCVWidget : ModuleWidget {
116116 module = _module;
117117 }
118118
119- void draw (const DrawArgs &args) override {
120- std::shared_ptr<Font> font = APP ->window ->loadFont (asset::plugin (pluginInstance, " res/fonts/PixelOperator.ttf" ));
121- if (font){
122- NVGcolor textColor = prepareDisplay (args.vg , &box, 22 );
123- nvgFontFaceId (args.vg , font->handle );
124- nvgTextLetterSpacing (args.vg , -1.5 );
125- nvgTextAlign (args.vg , NVG_ALIGN_CENTER );
126-
127- Vec textPos = Vec (box.size .x /2 , 21 .0f );
128- nvgFillColor (args.vg , textColor);
129-
130- if (module != NULL ){
131- get_chord_name (module ->root_semi ,module ->chord_type ,module ->inverted ,module ->bass_note ,text);
132- }else {
133- snprintf (text, 13 , " " );
119+ void drawLayer (const DrawArgs& args, int layer) override {
120+ if (layer == 1 ) {
121+ std::shared_ptr<Font> font = APP ->window ->loadFont (asset::plugin (pluginInstance, " res/fonts/PixelOperator.ttf" ));
122+ if (font){
123+ NVGcolor textColor = prepareDisplay (args.vg , &box, 22 );
124+ nvgFontFaceId (args.vg , font->handle );
125+ nvgTextLetterSpacing (args.vg , -1.5 );
126+ nvgTextAlign (args.vg , NVG_ALIGN_CENTER );
127+
128+ Vec textPos = Vec (box.size .x /2 , 21 .0f );
129+ nvgFillColor (args.vg , textColor);
130+
131+ if (module != NULL ){
132+ get_chord_name (module ->root_semi ,module ->chord_type ,module ->inverted ,module ->bass_note ,text);
133+ }else {
134+ snprintf (text, 13 , " " );
135+ }
136+
137+ nvgText (args.vg , textPos.x , textPos.y , text, NULL );
134138 }
135-
136- nvgText (args.vg , textPos.x , textPos.y , text, NULL );
137139 }
140+ Widget::drawLayer (args, layer);
138141 }
139142
140143 };
0 commit comments