Skip to content

Commit

Permalink
Fixes simple square not staying on when running demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Heher committed Feb 6, 2025
1 parent 552ef44 commit 03cc0cc
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions examples-api-use/demo-main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,18 @@ class SimpleSquare : public DemoRunner {
void Run() override {
const int width = canvas()->width() - 1;
const int height = canvas()->height() - 1;
// Borders
DrawLine(canvas(), 0, 0, width, 0, Color(255, 0, 0));
DrawLine(canvas(), 0, height, width, height, Color(255, 255, 0));
DrawLine(canvas(), 0, 0, 0, height, Color(0, 0, 255));
DrawLine(canvas(), width, 0, width, height, Color(0, 255, 0));

// Diagonals.
DrawLine(canvas(), 0, 0, width, height, Color(255, 255, 255));
DrawLine(canvas(), 0, height, width, 0, Color(255, 0, 255));

while (!interrupt_received) {
// Borders
DrawLine(canvas(), 0, 0, width, 0, Color(255, 0, 0));
DrawLine(canvas(), 0, height, width, height, Color(255, 255, 0));
DrawLine(canvas(), 0, 0, 0, height, Color(0, 0, 255));
DrawLine(canvas(), width, 0, width, height, Color(0, 255, 0));

// Diagonals.
DrawLine(canvas(), 0, 0, width, height, Color(255, 255, 255));
DrawLine(canvas(), 0, height, width, 0, Color(255, 0, 255));
}
}
};

Expand Down

0 comments on commit 03cc0cc

Please sign in to comment.