summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/teleia/src/ui.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/teleia/src/ui.rs b/crates/teleia/src/ui.rs
index 9f21fe2..49b8ad9 100644
--- a/crates/teleia/src/ui.rs
+++ b/crates/teleia/src/ui.rs
@@ -113,7 +113,7 @@ impl Cursor {
self.change_started = tick;
self.prev_index = self.index;
self.index = val;
- self.index %= self.bound;
+ if self.bound != 0 { self.index %= self.bound };
true
} else { false }
}
@@ -124,7 +124,7 @@ impl Cursor {
self.change_started = tick;
self.prev_index = self.index;
self.index = val;
- self.index %= self.bound;
+ if self.bound != 0 { self.index %= self.bound; }
}
pub fn finish_visually(&mut self) { self.prev_index = self.index; }
pub fn increment_unlocked(&mut self, tick: Tick) -> bool { self.set_unlocked(self.index + 1, tick); true }