Browse Source

Add scissor in LedDisplay::drawLayer().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
3ecced7389
2 changed files with 9 additions and 0 deletions
  1. +1
    -0
      include/app/LedDisplay.hpp
  2. +8
    -0
      src/app/LedDisplay.cpp

+ 1
- 0
include/app/LedDisplay.hpp View File

@@ -11,6 +11,7 @@ namespace app {

struct LedDisplay : widget::Widget {
void draw(const DrawArgs& args) override;
void drawLayer(const DrawArgs& args, int layer) override;
};

struct LedDisplaySeparator : widget::Widget {


+ 8
- 0
src/app/LedDisplay.cpp View File

@@ -65,6 +65,14 @@ void LedDisplay::draw(const DrawArgs& args) {
}


void LedDisplay::drawLayer(const DrawArgs& args, int layer) {
// Draw children inside box
nvgScissor(args.vg, RECT_ARGS(args.clipBox));
Widget::drawLayer(args, layer);
nvgResetScissor(args.vg);
}


LedDisplaySeparator::LedDisplaySeparator() {
box.size = math::Vec();
}


Loading…
Cancel
Save