mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: warn when fixed-size ArrayInit doesn't have trailing {}
. (#6137)
This commit is contained in:
@ -130,7 +130,7 @@ pub fn (ctx &Context) text_width(s string) int {
|
||||
if !ctx.font_inited {
|
||||
return 0
|
||||
}
|
||||
mut buf := [4]f32
|
||||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
return int((buf[2] - buf[0]) / ctx.scale)
|
||||
}
|
||||
@ -139,7 +139,7 @@ pub fn (ctx &Context) text_height(s string) int {
|
||||
if !ctx.font_inited {
|
||||
return 0
|
||||
}
|
||||
mut buf := [4]f32
|
||||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
return int((buf[3] - buf[1]) / ctx.scale)
|
||||
}
|
||||
@ -148,7 +148,7 @@ pub fn (ctx &Context) text_size(s string) (int, int) {
|
||||
if !ctx.font_inited {
|
||||
return 0,0
|
||||
}
|
||||
mut buf := [4]f32
|
||||
mut buf := [4]f32{}
|
||||
C.fonsTextBounds(ctx.ft.fons, 0, 0, s.str, 0, buf)
|
||||
return int((buf[2] - buf[0]) / ctx.scale), int((buf[3] - buf[1]) / ctx.scale)
|
||||
}
|
||||
|
Reference in New Issue
Block a user