Comments (15)
Hi,
It should work properly. Can you send your code?
from lvgl.
This is the function which is used to create the buttons:
`
#define PIN_X_PAD 5
#define PIN_Y_PAD 5
#define PIN_X_START 100
#define PIN_Y_START 200
lv_obj_t *bs[12];
void DrawKeyPad(lv_action_res_t (*kpFunc)(lv_obj_t *a, lv_dispi_t *b), lv_obj_t *scrn)
{
uint16_t x, y;
uint8_t c;
char ltr[] = "1";
lv_obj_t *label;
x = PIN_X_START;
y = PIN_Y_START;
for(c=1; c!=10; c++)
{
bs[c] = lv_btn_create(scrn, NULL);
lv_btn_set_pr_action(bs[c], kpFunc);
lv_cont_set_fit(bs[c], true, true);
lv_obj_set_pos(bs[c], x, y);
label = lv_label_create(bs[c], NULL);
ltr[0] = c+'0';
lv_label_set_text(label, ltr);
lv_obj_set_free_num(bs[c], c);
if((c==3) || (c==6))
{
x = PIN_X_START;
y = lv_obj_get_y(bs[c]) + lv_obj_get_height(bs[c]) + PIN_Y_PAD;
}
else
{
x = lv_obj_get_x(bs[c]) + lv_obj_get_width(bs[c]) + PIN_X_PAD;
}
}
area_t coords;
bs[0] = lv_btn_create(scrn, NULL);
lv_btn_set_pr_action(bs[0], kpFunc);
lv_cont_set_fit(bs[0], true, true);
label = lv_label_create(bs[0], NULL);
lv_label_set_text(label, "0");
lv_obj_set_free_num(bs[0], 0);
lv_obj_get_cords(bs[8], &coords);
lv_obj_set_pos(bs[0], coords.x1, coords.y2 + PIN_Y_PAD);
bs[10] = lv_btn_create(scrn, NULL);
lv_btn_set_pr_action(bs[10], kpFunc);
lv_cont_set_fit(bs[10], true, true);
label = lv_label_create(bs[10], NULL);
lv_label_set_text(label, "Done");
lv_obj_set_free_num(bs[10], 10);
lv_obj_get_cords(bs[3], &coords);
lv_obj_set_pos(bs[10], coords.x2 + (PIN_X_PAD*3), coords.y1);
bs[11] = lv_btn_create(scrn, NULL);
lv_btn_set_pr_action(bs[11], kpFunc);
lv_cont_set_fit(bs[11], true, true);
label = lv_label_create(bs[11], NULL);
lv_label_set_text(label, "Del");
lv_obj_set_free_num(bs[11], 11);
lv_obj_get_cords(bs[9], &coords);
lv_obj_set_pos(bs[11], coords.x2 + (PIN_X_PAD*3), coords.y1);
}
`
from lvgl.
I've tested you code. It was rendered for me correctly after pushing the button. The strange thing is the buttons have a radius by default which is missing on your image.
Please, attache your lv_conf.h
from lvgl.
lv_conf.h attached
from lvgl.
/* 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.
from lvgl.
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.
from lvgl.
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);
It produces me the following result:
from lvgl.
This is what I get:
from lvgl.
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?
from lvgl.
Yes, if you use lvgl:beta
, you should use misc:beta
as well. But in your case it can not be the problem. Anyway please checkout misc:beta
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!
from lvgl.
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:
Circle x: 10, y: 0
Circle x: 10, y: 1
Circle x: 10, y: 2
Circle x: 10, y: 3
Circle x: 9, y: 4
Circle x: 9, y: 5
Circle x: 8, y: 6
Circle x: 7, y: 7
from lvgl.
I get the same results for the code you gave above. misc_conf.h attached
misc_conf.zip
from lvgl.
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.
from lvgl.
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.
from lvgl.
I see. Then I close this issue again :)
Do you know what solved the issue?
from lvgl.
Related Issues (20)
- The chart with the faded area line cannot display the value pop-up when pressing a point? HOT 3
- `lv_obj_set_property()` with selector HOT 8
- stm32u5g9j-dk1 HOT 3
- Warning C4200 occurs frequently during build on VisualStudio. HOT 1
- Bar rotates automatically to horizontally if width>heigth HOT 3
- Compilation error using VG-Lite HOT 9
- [NOT A BUG] Label of List can't be centered. HOT 2
- [scale] Be able to configure the part drawing order
- LVGL Forum SPAMMER HOT 6
- Object Rotation for Binary Images HOT 5
- Incomplete implementation of lv_canvas_set_px() for indexed color format HOT 5
- The display will not receive the input event like press and release if a new screen is loaded. HOT 5
- Compilation error using PXP HOT 16
- Draw line using VG-Lite HOT 5
- Mosaic HOT 2
- Scrolling does not respect padding of parent. HOT 5
- Automatioc check for broken links in documentation HOT 4
- How to display Thai on the interface HOT 4
- Recoloring in V9 HOT 1
- ESP32 Rotate doesn't work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lvgl.