From 03cc0cc25194c03d0effff56cf6b82a3cd58d45d Mon Sep 17 00:00:00 2001 From: John Heher Date: Thu, 6 Feb 2025 17:19:43 -0600 Subject: [PATCH] Fixes simple square not staying on when running demo --- examples-api-use/demo-main.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/examples-api-use/demo-main.cc b/examples-api-use/demo-main.cc index a055dfe9c..172ac9e54 100644 --- a/examples-api-use/demo-main.cc +++ b/examples-api-use/demo-main.cc @@ -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)); + } } };