From 1c34777024df351645835b23630fd2880445b0bc Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 2 Jan 2018 12:59:18 +0100 Subject: [PATCH] line width bugfox width anti-aliasing --- lv_draw/lv_draw.c | 1 + lv_themes/lv_theme_alien.c | 2 +- lv_themes/lv_theme_default.c | 2 +- lv_themes/lv_theme_night.c | 4 ++-- lv_themes/lv_theme_zen.c | 6 +++--- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lv_draw/lv_draw.c b/lv_draw/lv_draw.c index a59b9e1c2..55d9cbbd0 100644 --- a/lv_draw/lv_draw.c +++ b/lv_draw/lv_draw.c @@ -574,6 +574,7 @@ void lv_draw_line(const lv_point_t * p1, const lv_point_t * p2, const lv_area_t /*Make the correction on lie width*/ width = ((style->line.width - 1) * width_corr_array[wcor]) >> LINE_WIDTH_CORR_SHIFT; + width = width << LV_ANTIALIAS; width_half = width >> 1; width_1 = width & 0x1 ? 1 : 0; diff --git a/lv_themes/lv_theme_alien.c b/lv_themes/lv_theme_alien.c index b8b9957ed..5f09e1810 100644 --- a/lv_themes/lv_theme_alien.c +++ b/lv_themes/lv_theme_alien.c @@ -371,7 +371,7 @@ static void gauge_init(void) gauge_bg.body.padding.inner = LV_DPI / 8; /*Label - scale distance*/ gauge_bg.body.border.color = LV_COLOR_HEX3(0x777); gauge_bg.line.color = lv_color_hsv_to_rgb(_hue, 80, 75); - gauge_bg.line.width = 3; + gauge_bg.line.width = 2; gauge_bg.text.color = lv_color_hsv_to_rgb(_hue, 10, 90); gauge_bg.text.font = _font; diff --git a/lv_themes/lv_theme_default.c b/lv_themes/lv_theme_default.c index c0e00c82e..bbdc86135 100644 --- a/lv_themes/lv_theme_default.c +++ b/lv_themes/lv_theme_default.c @@ -191,7 +191,7 @@ static void gauge_init(void) static lv_style_t gauge; lv_style_copy(&gauge, &lmeter); gauge.line.color = lmeter.body.grad_color; - gauge.line.width = 3; + gauge.line.width = 2; gauge.body.main_color = LV_COLOR_HEX3(0x888); gauge.body.grad_color = lmeter.body.main_color; gauge.text.color = LV_COLOR_HEX3(0x888); diff --git a/lv_themes/lv_theme_night.c b/lv_themes/lv_theme_night.c index 1d374fb02..c954a74f0 100644 --- a/lv_themes/lv_theme_night.c +++ b/lv_themes/lv_theme_night.c @@ -256,7 +256,7 @@ static void lmeter_init(void) lmeter_bg.body.padding.inner = LV_DPI / 10; /*Text padding*/ lmeter_bg.body.border.color = LV_COLOR_HEX3(0x333); lmeter_bg.line.color = LV_COLOR_HEX3(0x555); - lmeter_bg.line.width = 2 << LV_ANTIALIAS; + lmeter_bg.line.width = 2; lmeter_bg.text.color = LV_COLOR_HEX3(0xddd); theme.lmeter = &lmeter_bg; @@ -271,7 +271,7 @@ static void gauge_init(void) gauge_bg.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 70); gauge_bg.body.grad_color = gauge_bg.body.main_color; gauge_bg.line.color = lv_color_hsv_to_rgb(_hue, 80, 75); - gauge_bg.line.width = 3; + gauge_bg.line.width = 2; gauge_bg.text.color = LV_COLOR_HEX3(0xddd); theme.gauge = &gauge_bg; diff --git a/lv_themes/lv_theme_zen.c b/lv_themes/lv_theme_zen.c index 51f970851..d66d800aa 100644 --- a/lv_themes/lv_theme_zen.c +++ b/lv_themes/lv_theme_zen.c @@ -267,7 +267,7 @@ static void lmeter_init(void) lv_style_copy(&lmeter, &def); lmeter.line.color = LV_COLOR_HEX3(0xddd); - lmeter.line.width = 3; + lmeter.line.width = 2; lmeter.body.main_color = lv_color_hsv_to_rgb(_hue, 80, 70); lmeter.body.grad_color = lmeter.body.main_color; lmeter.body.padding.hor = LV_DPI / 8; @@ -283,10 +283,10 @@ static void gauge_init(void) lv_style_copy(&gauge, &def); gauge.line.color = lv_color_hsv_to_rgb(_hue, 50, 70); - gauge.line.width = 3; + gauge.line.width = 2; gauge.body.main_color = LV_COLOR_HEX3(0x999); gauge.body.grad_color = gauge.body.main_color; - gauge.body.padding.hor = LV_DPI / 6; + gauge.body.padding.hor = LV_DPI / 12; gauge.body.border.color = LV_COLOR_HEX3(0x666); /*Needle middle color*/ theme.gauge = &gauge;