diff options
author | Ville Hakulinen <ville.hakulinen@gmail.com> | 2020-08-13 11:02:04 +0300 |
---|---|---|
committer | Ville Hakulinen <ville.hakulinen@gmail.com> | 2020-08-13 11:02:04 +0300 |
commit | 1a47380c296c1ae4e9e82f19538cdac051afe1b7 (patch) | |
tree | 3552c412366352730b75fafa28981247081357d1 | |
parent | e0c17550a846c0e49146ca497951be0d3d332f10 (diff) |
Don't do cursor blink animation if not needed
Fix #138
Fix #141
-rw-r--r-- | src/ui/grid/context.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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; |