-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Possible issue with buttons #22
Comments
Hi, It should work properly. Can you send your code? |
This is the function which is used to create the buttons: ` lv_obj_t *bs[12]; void DrawKeyPad(lv_action_res_t (*kpFunc)(lv_obj_t *a, lv_dispi_t *b), lv_obj_t *scrn)
} |
lv_conf.h attached |
/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/
#define LV_VDB_SIZE (LV_HOR_RES * (LV_RES/10)) // (LV_HOR_RES * 30) I suppose LV_RES is your own define. What is its value? Setting LV_RES to a 80 worked for me well. |
LV_RES is set to the same as LV_VER_RES. Setting it to 80 has fixed that issue but looks to have caused others but I'll dig into them and open a new issue if I can locate the cause. |
It works for me with LV_VER_RES too. It seems the borders are also missing on your buttons. Please try this code: static lv_style_t style_test;
lv_style_get(LV_STYLE_PRETTY_COLOR, &style_test);
style_test.empty = 1;
style_test.bwidth = 1 * LV_DOWNSCALE;
style_test.bcolor= COLOR_RED;
style_test.ccolor= COLOR_BLUE;
/*Red border*/
lv_obj_t * obj1 = lv_obj_create(lv_scr_act(), NULL);
lv_obj_set_style(obj1, &style_test);
lv_obj_set_pos(obj1, 10, 10);
/*Blue line*/
lv_obj_t * obj2 = lv_line_create(lv_scr_act(), NULL);
lv_obj_set_style(obj2, &style_test);
lv_obj_set_pos(obj2, 150, 10);
lv_line_set_auto_size(obj2, true);
static point_t points[2] = {{5, 5},{50, 5}}; /*Modify the coordinates to test*/
lv_line_set_points(obj2, points, 2); |
One thought - I'm currently using beta code but have only been updating lvgl and not misc. Does that need to be checked out as well? |
Yes, if you use On your screenshot it is clearly seen the corners are not drawn. It is very strange. It seems the circle drawing algorithm is not working for you. Please attache your misc_conf.h as well. Maybe we find the issue there. Thank you in advance! |
Please try this code as well to test circle drawing (#include "misc/gfx/circ.h"): point_t c;
cord_t tmp;
circ_init(&c, &tmp, 10);
cord_t x = 0;
cord_t y = 0;
while(circ_cont(&c)) {
x = CIRC_OCT1_X(c);
y = CIRC_OCT1_Y(c);
printf("Circle x: %d, y: %d\n", x, y); /*Somehow print/read the variables*/
circ_next(&c, &tmp);
} For me the output is:
|
I get the same results for the code you gave above. misc_conf.h attached |
misc_conf.h looks good. Are you using compiler optimization? If yes please try without it. If it doesn't help we need to dig deeper. In lv_draw/lv_draw.c lv_draw_rect_border_corner() draws the rectangle border. You can dubug it to see whether it draws the circles cyclically or not. Don't care about what it does just see it draws in a cycle. The previous red border, blue line code is good to test. |
With optimisation off it creates such a large binary that it won't run. This is no longer an issue, though, as I now have rounded corners on buttons and do not have the ghost border decorations. |
I see. Then I close this issue again :) Do you know what solved the issue? |
Modify lv_test_theme_1 for "one toggle" mode
Fix compile-time warnings in lv_sjpg.c.
Using default style for container and buttons (each button has its own object):
Before pressing "1":
After pressing "1":
Note corner "decorations" which appear after pressing
The text was updated successfully, but these errors were encountered: