From 2bca0f5d0afb5a1a83ae454c7d6b88508d93366b Mon Sep 17 00:00:00 2001 From: nerdopolis Date: Fri, 16 Jun 2023 23:18:07 -0400 Subject: [PATCH] label-freetype: Fix Uncrustify --- src/plugins/controls/label-freetype/plugin.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/plugins/controls/label-freetype/plugin.c b/src/plugins/controls/label-freetype/plugin.c index 79c55d81..0fbf0945 100644 --- a/src/plugins/controls/label-freetype/plugin.c +++ b/src/plugins/controls/label-freetype/plugin.c @@ -156,21 +156,23 @@ static FT_Int width_of_line (ply_label_plugin_control_t *label, const char *text) { + FT_Error error; FT_Int width = 0; FT_Int left_bearing = 0; while (*text != '\0' && *text != '\n') { - if(FT_Load_Char (label->face, *text, FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT)) - continue; + error = FT_Load_Char (label->face, *text, FT_LOAD_RENDER | FT_LOAD_TARGET_LIGHT); - width += label->face->glyph->advance.x >> 6; - left_bearing = label->face->glyph->bitmap_left; - /* We don't "go back" when drawing, so when left bearing is - * negative (like for 'j'), we simply add to the width. */ - if (left_bearing < 0) - width += -left_bearing; + if (!error) { + width += label->face->glyph->advance.x >> 6; + left_bearing = label->face->glyph->bitmap_left; + /* We don't "go back" when drawing, so when left bearing is + * negative (like for 'j'), we simply add to the width. */ + if (left_bearing < 0) + width += -left_bearing; - ++text; + ++text; + } } return width; -- 2.47.2