From 553d2ffc8eed9b5f9f2ebd52ee070ed1dcd0c5b6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 15 Aug 2021 04:15:29 -0700 Subject: . Make it more obvious that we always do a full repaint if dirty is set. --- browse-slack/environment.mu | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'browse-slack') diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu index c7f0c04f..3d206604 100644 --- a/browse-slack/environment.mu +++ b/browse-slack/environment.mu @@ -66,20 +66,22 @@ fn initialize-environment _self: (addr environment), _items: (addr item-list) { fn render-environment screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) { var env/esi: (addr environment) <- copy _env - # don't bother repainting the screen when typing into the search bar - # (and screen isn't dirty) { - var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search? - compare *cursor-in-search?, 0/false - break-if-= var dirty?/eax: (addr boolean) <- get env, dirty? compare *dirty?, 0/false break-if-!= - render-search-input screen, env - clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg - render-search-menu screen, env - return + # minimize repaints when typing into the search bar + { + var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search? + compare *cursor-in-search?, 0/false + break-if-= + render-search-input screen, env + clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg + render-search-menu screen, env + return + } } + # full repaint clear-screen screen render-search-input screen, env render-channels screen, env, channels @@ -381,12 +383,7 @@ fn render-menu screen: (addr screen), _env: (addr environment) { render-channels-menu screen, env return } - compare *cursor-in-channels?, 0/false - { - break-if-!= - render-main-menu screen, env - return - } + render-main-menu screen, env } fn render-main-menu screen: (addr screen), _env: (addr environment) { -- cgit 1.4.1-2-gfad0