mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
fix shorter-than-one-line text fitting problem
right character gets cut off, but it's because the cursor is the top left of the last character. add one character height plus margin to the shortening, because the margin itself could be 0 in many case.
This commit is contained in:
parent
1424eca689
commit
8b992bbe38
2 changed files with 6 additions and 6 deletions
|
|
@ -192,8 +192,8 @@ fn xmain() -> ! {
|
|||
};
|
||||
// if less than one line of text, shrink the box
|
||||
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
|
||||
if c.pt.x as i16 + c.line_height as i16 + tv.margin.x < checkedwidth {
|
||||
c.pt.x as i16 + c.line_height as i16 + tv.margin.x
|
||||
} else {
|
||||
checkedwidth
|
||||
}
|
||||
|
|
@ -243,8 +243,8 @@ fn xmain() -> ! {
|
|||
|
||||
// if less than one line of text, shrink the box
|
||||
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
|
||||
if c.pt.x as i16 + c.line_height as i16 + tv.margin.x < checkedwidth {
|
||||
c.pt.x as i16 + c.line_height as i16 + tv.margin.x
|
||||
} else {
|
||||
checkedwidth
|
||||
}
|
||||
|
|
@ -299,8 +299,8 @@ fn xmain() -> ! {
|
|||
|
||||
// if less than one line of text, shrink the box
|
||||
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
|
||||
if c.pt.x as i16 + c.line_height as i16 + tv.margin.x < checkedwidth {
|
||||
c.pt.x as i16 + c.line_height as i16 + tv.margin.x
|
||||
} else {
|
||||
checkedwidth
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue