fix less than one line check criteria

This commit is contained in:
bunnie 2021-03-10 01:36:40 +08:00
parent 44c1b66b8b
commit ab277a6cdd

View file

@ -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 {