From ad899617373bd797a0952907b451e461cb3a9ca1 Mon Sep 17 00:00:00 2001 From: Gabor Date: Mon, 27 Mar 2017 09:27:45 +0200 Subject: [PATCH] lv_ddlist: bugfix with font antialiassing --- lv_objx/lv_ddlist.c | 5 +++-- lvgl.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lv_objx/lv_ddlist.c b/lv_objx/lv_ddlist.c index f5e494302..21cb4cf1e 100644 --- a/lv_objx/lv_ddlist.c +++ b/lv_objx/lv_ddlist.c @@ -314,7 +314,7 @@ static bool lv_ddlist_design(lv_obj_t * ddlist, const area_t * mask, lv_design_m cord_t font_h = font_get_height(font) >> LV_FONT_ANTIALIAS; area_t rect_area; rect_area.y1 = ext->opt_label->cords.y1; - rect_area.y1 += ext->sel_opt * font_h + style->list_labels.line_space; + rect_area.y1 += ext->sel_opt * (font_h + style->list_labels.line_space); rect_area.y1 -= style->sel_rects.vpad; rect_area.y2 = rect_area.y1 + font_h + 2 * style->sel_rects.vpad; @@ -434,9 +434,10 @@ static void lv_ddlist_pos_act_option(lv_obj_t * ddlist) lv_ddlist_ext_t * ext = lv_obj_get_ext(ddlist); lv_ddlists_t * style = lv_obj_get_style(ddlist); const font_t * font = font_get(style->list_labels.font); + cord_t font_h = font_get_height(font) >> LV_FONT_ANTIALIAS; lv_obj_set_y(lv_page_get_scrl(ddlist), - -(ext->sel_opt * (font_get_height(font) + style->list_labels.line_space) + + -(ext->sel_opt * (font_h + style->list_labels.line_space) + style->pages.scrl_rects.vpad) + style->sel_rects.vpad); } diff --git a/lvgl.h b/lvgl.h index 6e7d7a04c..12fac2b0f 100644 --- a/lvgl.h +++ b/lvgl.h @@ -3,8 +3,8 @@ * Include all LittleV GL related headers */ -#ifndef LV_GL_H -#define LV_GL_H +#ifndef LVGL_H +#define LVGL_H /********************* * INCLUDES @@ -28,7 +28,6 @@ #error "LV: incompatible misc. module version! See lvgl.h" #endif -#include #include "lv_obj/lv_obj.h" #include "lv_objx/lv_btn.h" #include "lv_objx/lv_img.h" @@ -37,6 +36,7 @@ #include "lv_objx/lv_page.h" #include "lv_objx/lv_rect.h" #include "lv_objx/lv_list.h" +#include "lv_objx/lv_chart.h" #include "lv_objx/lv_cb.h" #include "lv_objx/lv_pb.h" #include "lv_objx/lv_led.h"