mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
freetype: max_width
This commit is contained in:
parent
53b06048d2
commit
d1664dc511
@ -367,6 +367,12 @@ fn (ctx mut FreeType) private_draw_text(_x, _y int, utext ustring, cfg gx.TextCf
|
||||
// Render quad
|
||||
gl.draw_arrays(C.GL_TRIANGLES, 0, 6)
|
||||
x += f32(ch.horizontal_advance_px)
|
||||
// Stop drawing if the limit is reached
|
||||
if cfg.max_width > 0 {
|
||||
if x >= cfg.max_width {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
gl.bind_vao(u32(0))
|
||||
C.glBindTexture(C.GL_TEXTURE_2D, 0)
|
||||
|
Loading…
Reference in New Issue
Block a user