1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

freetype: fix align.right rendering

This commit is contained in:
Alexander Medvednikov
2020-01-16 17:03:31 +01:00
parent 1e98a227cc
commit 756c6d2858
3 changed files with 10 additions and 9 deletions

View File

@@ -262,7 +262,8 @@ fn (ctx mut FreeType) private_draw_text(_x, _y int, utext ustring, cfg gx.TextCf
mut y := f32(_y)
// println('scale=$ctx.scale size=$cfg.size')
if cfg.align == gx.ALIGN_RIGHT {
width := utext.len * 7
//width := utext.len * 7
width := ctx.text_width(utext.s)
x -= width + 10
}
x *= ctx.scale// f32(2)