mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
checker: fixed array cannot implicitly convert to fooptr (again) (#9302)
This commit is contained in:
parent
9d168895ed
commit
446631ceb5
15 changed files with 58 additions and 32 deletions
|
@ -215,7 +215,7 @@ pub fn (ctx &Context) text_width(s string) int {
|
|||
return 0
|
||||
}
|
||||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, &buf[0])
|
||||
if s.ends_with(' ') {
|
||||
return int((buf[2] - buf[0]) / ctx.scale) +
|
||||
ctx.text_width('i') // TODO fix this in fontstash?
|
||||
|
@ -236,7 +236,7 @@ pub fn (ctx &Context) text_height(s string) int {
|
|||
return 0
|
||||
}
|
||||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, &buf[0])
|
||||
return int((buf[3] - buf[1]) / ctx.scale)
|
||||
}
|
||||
|
||||
|
@ -246,7 +246,7 @@ pub fn (ctx &Context) text_size(s string) (int, int) {
|
|||
return 0, 0
|
||||
}
|
||||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, &buf[0])
|
||||
return int((buf[2] - buf[0]) / ctx.scale), int((buf[3] - buf[1]) / ctx.scale)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue