From 1a47380c296c1ae4e9e82f19538cdac051afe1b7 Mon Sep 17 00:00:00 2001 From: Ville Hakulinen Date: Thu, 13 Aug 2020 11:02:04 +0300 Subject: Don't do cursor blink animation if not needed Fix #138 Fix #141 --- src/ui/grid/context.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/grid/context.rs b/src/ui/grid/context.rs index 05e203e..03a9ebe 100644 --- a/src/ui/grid/context.rs +++ b/src/ui/grid/context.rs @@ -263,6 +263,11 @@ impl Context { self.cursor.tick(clock.get_frame_time()); + // We're not blinking, so skip the blink animation phase. + if self.cursor.blink_on == 0 { + return; + } + let (x, y, w, h) = self.get_cursor_rect(); let mut alpha = self.cursor.alpha; -- cgit v1.2.3