From 3e6f7d3eb687e37b1bf623463014ae2bc4b6df48 Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 13 May 2020 00:50:46 +0200 Subject: [PATCH] freetype: minor fixes --- vlib/freetype/freetype.v | 4 ++-- vlib/v/checker/checker.v | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/vlib/freetype/freetype.v b/vlib/freetype/freetype.v index eb40cfde70..60e0e17b60 100644 --- a/vlib/freetype/freetype.v +++ b/vlib/freetype/freetype.v @@ -292,7 +292,7 @@ fn (ctx mut FreeType) private_draw_text(_x, _y int, utext ustring, cfg gx.TextCf mut x := f32(_x) mut y := f32(_y) wx, wy := ctx.text_size(utext.s) - yoffset := if ctx.scale > 1 { 5 /* highdpi */ } else { -1 /* lowdpi */ } + yoffset := if ctx.scale > 1 { 5 } else { -1 } // 5 hidpi, -1 lowdpi // println('scale=$ctx.scale size=$cfg.size') if cfg.align == gx.ALIGN_RIGHT { //width := utext.len * 7 @@ -374,7 +374,7 @@ fn (ctx mut FreeType) private_draw_text(_x, _y int, utext ustring, cfg gx.TextCf // Stop drawing if the limit is reached if cfg.max_width > 0 { if x >= cfg.max_width { - break + //break } } } diff --git a/vlib/v/checker/checker.v b/vlib/v/checker/checker.v index 21962d3e0c..6a627b336a 100644 --- a/vlib/v/checker/checker.v +++ b/vlib/v/checker/checker.v @@ -234,8 +234,7 @@ pub fn (mut c Checker) struct_decl(decl ast.StructDecl) { if !c.table.check(field_expr_type, field.typ) { field_expr_type_sym := c.table.get_type_symbol(field_expr_type) field_type_sym := c.table.get_type_symbol(field.typ) - c.error('default expression for field `${field.name}` ' + - 'has type `${field_expr_type_sym.name}`, but should be `${field_type_sym.name}`', + c.error('default expression for field `${field.name}` ' + 'has type `${field_expr_type_sym.name}`, but should be `${field_type_sym.name}`', field.default_expr.position()) } } @@ -256,7 +255,7 @@ pub fn (mut c Checker) struct_init(mut struct_init ast.StructInit) table.Type { struct_init.typ = c.expected_type } type_sym := c.table.get_type_symbol(struct_init.typ) - if !type_sym.is_public && type_sym.mod != c.mod { + if !type_sym.is_public && type_sym.kind != .placeholder && type_sym.mod != c.mod { c.warn('type `$type_sym.name` is private', struct_init.pos) } // println('check struct $typ_sym.name')