This is very weird.
All I’m doing at this point, is trying to put a simple object on the screen, an arc, then a button, both in the center of the screen.
I’m using a 4" CYD. In general, everything works. Using it landscape mode with the USB connector to the left. (data says: 320W x 480H, so landscape it’s 480W x 320H). Touch is OK, upper left corner is 0,0 - lower right is 480x320 (or close enough)
This is the code, I’m not doing anything else, no styles, nothing. Just set it up and place an arc. followed with a button.
If I place an object on the screen via:
lv_obj_t * test_arc = lv_arc_create(lv_screen_active());
lv_obj_set_size(test_arc, 250, 250);
lv_obj_center(test_arc);
If I try
lv_obj_t * test_arc = lv_arc_create(lv_screen_active());
lv_obj_set_size(test_arc, lv_pct(50), lv_pct(50));
lv_obj_center(test_arc);
It has an offset of about 65 pixels to the left.
I get the feeling it has something to do with the screen configuration, but I can not find it.
The setup is:
disp = lv_tft_espi_create(320, 480, draw_buf, sizeof(draw_buf));
//disp = lv_display_create(480, 320);
lv_display_set_buffers(disp, draw_buf, NULL, sizeof(draw_buf), LV_DISPLAY_RENDER_MODE_PARTIAL);
lv_display_set_rotation(disp, LV_DISPLAY_ROTATION_270); // 0 = , 90 = , 180 = , 270 = upright
lv_display_set_physical_resolution(disp, 480, 320);
Now, I KNOW that the horz and vert are reversed in there, but that’s the only way it works. If I put the correct numbers in (the commented out line), I only get a display 320 wide on a 480 wide display.
If I follow the arc using lv_pct(xx) (placed with offset), with a button using direct placement, it places it in the center where it should be. So it’s lv_pct(xx) only.
(even so, simply giving an object size is correct, but using percent throws it off, so there’s really two things going on, but they’re replated I’m sure, pct must be using a different screen configuration from direct placement. at least I think so…)
Any ideas? Suggestions? Answers?
Thanks,
OMG (and getting older, fast…)