mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: fixed array cannot implicitly convert to fooptr (again) (#9302)
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user