From ab277a6cdd8ab9870ce40104e692354f06a4591a Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 10 Mar 2021 01:36:40 +0800 Subject: [PATCH] fix less than one line check criteria --- services/graphics-server/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/graphics-server/src/main.rs b/services/graphics-server/src/main.rs index 787e9c232..2603fdee2 100644 --- a/services/graphics-server/src/main.rs +++ b/services/graphics-server/src/main.rs @@ -216,7 +216,7 @@ fn xmain() -> ! { br.y as i16 - clip_rect.tl.y as i16 }; // if less than one line of text, shrink the box - let finalwidth = if c.pt.y <= c.line_height { + let finalwidth = if c.pt.y == 0 { if c.pt.x as i16 + tv.margin.x * 3 < checkedwidth { c.pt.x as i16 + tv.margin.x * 3 } else { @@ -272,7 +272,7 @@ fn xmain() -> ! { }; // if less than one line of text, shrink the box - let finalwidth = if c.pt.y <= c.line_height { + let finalwidth = if c.pt.y == 0 { if c.pt.x as i16 + tv.margin.x * 3 < checkedwidth { c.pt.x as i16 + tv.margin.x * 3 } else {