From 93971d4481e3ea727685344a5c337fb20b639778 Mon Sep 17 00:00:00 2001 From: Zachary S Date: Sun, 6 Apr 2025 01:28:43 -0500 Subject: [PATCH] Do not push cursor down if we are at position 0, even if the widget is too wide. --- src/ui/cursor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/cursor.rs b/src/ui/cursor.rs index d6fb6a80..2919d8cb 100644 --- a/src/ui/cursor.rs +++ b/src/ui/cursor.rs @@ -107,7 +107,8 @@ impl Cursor { Layout::Horizontal => { self.max_row_y = self.max_row_y.max(size.y); - if self.x + size.x < self.area.w - self.margin * 2. { + // self.x < 1.0 is a hack to not push the first item down if it is too wide to fit. + if self.x < 1.0 || self.x + size.x < self.area.w - self.margin * 2. { res = Vec2::new(self.x, self.y); } else { self.x = self.margin + 1.; // +1. is a hack to make next vertical thing correctly jump to the next row