checker: fixed array cannot implicitly convert to fooptr (again) (#9302)

This commit is contained in:
Nick Treleaven 2021-03-15 13:55:07 +00:00 committed by GitHub
parent 9d168895ed
commit 446631ceb5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 58 additions and 32 deletions

View file

@ -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)
}