Performance meter text invisible

Anyone have any suggestions as to what could cause the percentage text of my prototype module performance meter to be invisible?

I was thinking possibly something to do with nvg since I am using it to draw the panel:

  static NVGcolor panelColour{nvgRGBA(0, 173, 236, 255)};
  static NVGcolor textColour{nvgRGBA(0, 0, 0, 255)};

  template <typename W>
  static void drawPanel(NVGcontext *vg, W *widget)
  {
    nvgBeginPath(vg);
    nvgFillColor(vg, panelColour);
    nvgStrokeColor(vg, textColour);
    nvgStrokeWidth(vg, 1.0f);
    nvgRect(vg, 0, 0, widget->box.size.x, widget->box.size.y);
    nvgFill(vg);
    nvgStroke(vg);
  }

try to put at the start

        nvgSave(vg);

and at the end of your method:

        nvgResetScissor(vg);
        nvgRestore(vg);

(just in case you are modifying context attributes, clippings, etc)

4 Likes

Yep, that’s fixed it, thanks Antonio

1 Like