Browse Source

Use nvgGlobalTint() instead of nvgGlobalAlpha() for drawing lights.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
5906dc0d87
2 changed files with 3 additions and 3 deletions
  1. +2
    -2
      src/app/LedDisplay.cpp
  2. +1
    -1
      src/app/LightWidget.cpp

+ 2
- 2
src/app/LedDisplay.cpp View File

@@ -54,7 +54,7 @@ void LedDisplayChoice::draw(const DrawArgs& args) {
}

std::shared_ptr<window::Font> font = APP->window->loadFont(fontPath);
nvgGlobalAlpha(args.vg, 1.0);
nvgGlobalTint(args.vg, color::WHITE);
if (font && font->handle >= 0) {
nvgFillColor(args.vg, color);
nvgFontFaceId(args.vg, font->handle);
@@ -99,7 +99,7 @@ void LedDisplayTextField::draw(const DrawArgs& args) {

// Text
std::shared_ptr<window::Font> font = APP->window->loadFont(fontPath);
nvgGlobalAlpha(args.vg, 1.0);
nvgGlobalTint(args.vg, color::WHITE);
if (font && font->handle >= 0) {
bndSetFont(font->handle);



+ 1
- 1
src/app/LightWidget.cpp View File

@@ -15,7 +15,7 @@ void LightWidget::draw(const DrawArgs& args) {

// Dynamic light and halo
// Override tint from rack brightness adjustment
nvgGlobalAlpha(args.vg, 1.0);
nvgGlobalTint(args.vg, color::WHITE);
// Use the formula `lightColor * (1 - dest) + dest` for blending
nvgGlobalCompositeBlendFunc(args.vg, NVG_ONE_MINUS_DST_COLOR, NVG_ONE);
drawLight(args);


Loading…
Cancel
Save