mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
fmt: smarter if condition wrapping (#8201)
This commit is contained in:
parent
9812230847
commit
8b61891348
65 changed files with 686 additions and 811 deletions
|
@ -184,8 +184,8 @@ pub fn (ctx &Context) text_width(s string) int {
|
|||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
if s.ends_with(' ') {
|
||||
return int((buf[2] - buf[0]) /
|
||||
ctx.scale) + ctx.text_width('i') // TODO fix this in fontstash?
|
||||
return int((buf[2] - buf[0]) / ctx.scale) +
|
||||
ctx.text_width('i') // TODO fix this in fontstash?
|
||||
}
|
||||
return int((buf[2] - buf[0]) / ctx.scale)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue