From 27fad0f19b69fcff9500cc33443c7f136fc41644 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Thu, 8 Aug 2019 10:08:39 +0200 Subject: [PATCH] ft: clean up --- compiler/fn.v | 6 +++--- vlib/ft/ft.v | 13 +++++-------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/compiler/fn.v b/compiler/fn.v index acaf03d813..4ce0f06cca 100644 --- a/compiler/fn.v +++ b/compiler/fn.v @@ -794,16 +794,16 @@ fn (p mut Parser) fn_call_args(f mut Fn) *Fn { // `mut numbers := [1,2,3]; reverse(mut numbers);` if arg.is_mut { if p.tok != .key_mut { - p.error('`$arg.name` is a key_mut argument, you need to provide `mut`: `$f.name(...mut a...)`') + p.error('`$arg.name` is a mutable argument, you need to provide `mut`: `$f.name(...mut a...)`') } if p.peek() != .name { - p.error('`$arg.name` is a key_mut argument, you need to provide a variable to modify: `$f.name(... mut a...)`') + p.error('`$arg.name` is a mutable argument, you need to provide a variable to modify: `$f.name(... mut a...)`') } p.check(.key_mut) var_name := p.lit v := p.cur_fn.find_var(var_name) if v.name == '' { - p.error('`$arg.name` is a key_mut argument, you need to provide a variable to modify: `$f.name(... mut a...)`') + p.error('`$arg.name` is a mutable argument, you need to provide a variable to modify: `$f.name(... mut a...)`') } if !v.is_changed { p.cur_fn.mark_var_changed(v) diff --git a/vlib/ft/ft.v b/vlib/ft/ft.v index 38ae616aec..f06939be7c 100644 --- a/vlib/ft/ft.v +++ b/vlib/ft/ft.v @@ -6,11 +6,11 @@ module ft import ( os -gx -gg - stbi - glm - gl + gx + gg + stbi + glm + gl ) #flag darwin -I/usr/local/Cellar/freetype/2.10.0/include/freetype2 @@ -248,11 +248,9 @@ fn (ctx mut GG) init_utf8_runes() { // fn (ctx &GG) render_text(text string, x, y, scale f32, color gx.Color) { pub fn (ctx &GG) draw_text(_x, _y int, text string, cfg gx.TextCfg) { -println('draw text start') utext := text.ustring_tmp() // utext := text.ustring() ctx._draw_text(_x, _y, utext, cfg) -println('draw text end') // utext.free() // # glScissor(0,0,ctx->width*2,ctx->height*2); // gl.disable(GL_SCISSOR_TEST)// TODO @@ -289,7 +287,6 @@ fn (ctx &GG) _draw_text(_x, _y int, utext ustring, cfg gx.TextCfg) { // _y = _y * int(ctx.scale) //+ 26 y = y * int(ctx.scale) + ((cfg.size * ctx.scale) / 2) + 5 * ctx.scale y = f32(ctx.height) - y -println('($x, $y)' ) color := cfg.color // Activate corresponding render state ctx.shader.use()