Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lv_label glitch when container is smaller than label size #7657

Open
shahawi-sumup opened this issue Jan 24, 2025 · 0 comments
Open

lv_label glitch when container is smaller than label size #7657

shahawi-sumup opened this issue Jan 24, 2025 · 0 comments

Comments

@shahawi-sumup
Copy link

LVGL version

v8.4.0

Platform

Simulator (Linux SDL2)

What happened?

I'm migrating from LVGL v7.11 to v8.4.0

As you can see in the attached screenshot when a label is inside of a smaller container, there is an extra black bar got drawn randomly (on the side, or on the bottom).

Image

In LVGL v7.11, this wasn't an issue, was always working.

Thanks in advance :)

How to reproduce?

void bug_screen()
{
    lv_obj_t* screen = lv_scr_act();
    lv_obj_clean(screen);

    /* Case1: Hello World label working fine */
    lv_obj_t* cont = lv_obj_create(screen);
    lv_obj_set_flex_flow(cont, LV_FLEX_FLOW_ROW);
    lv_obj_set_size(cont, LV_SIZE_CONTENT, LV_SIZE_CONTENT);

    lv_obj_t* lbl = lv_label_create(cont);
    lv_label_set_text(lbl, "Hello World!");
    lv_obj_align(cont, LV_ALIGN_TOP_LEFT, 0, 10);

    /* Case2: Hello World label has a bug of an extra black bar drawn below H letter */
    lv_obj_t* cont2 = lv_obj_create(screen);
    lv_obj_set_size(cont2, 50, LV_SIZE_CONTENT);
    lv_obj_t* lbl2 = lv_label_create(cont2);
    lv_label_set_text(lbl2, "Hello World!");
    lv_obj_align(cont2, LV_ALIGN_BOTTOM_LEFT, 0, -10);

    /* Case3: X label has a bug of an extra black bar drawn on the right side */
    lv_obj_t* cont3 = lv_obj_create(screen);
    lv_obj_set_size(cont3, 20, 30);
    lv_obj_t* lbl3 = lv_label_create(cont3);
    lv_label_set_text(lbl3, "x");
    lv_obj_align(lbl3, LV_ALIGN_CENTER, 0, 0);
    lv_obj_align(cont3, LV_ALIGN_CENTER, 0, 0);

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant