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_area_is_on function bug #96
Comments
You are right. Thank you. I don't how could this remain hidden so long because it is an essential function. I think I need to re-think this function. Now it is too complicated. Have a good implemntation idea? |
It looks like this is the simplest solution for checking if two rectangles overlap:
Found here: https://stackoverflow.com/questions/306316/determine-if-two-rectangles-overlap-each-other |
Reference program: `#define ABS(x) ((x)>0?(x):-(x)) bool lv_area_is_on(const lv_area_t * a1_p, const lv_area_t * a2_p)
}` |
Thank you for the very deep work and explanation. |
@upbeat27 |
@kisvegabor I forgot to adjust the y axis for increasing top to bottom in the above example.
|
@upbeat27 |
Can not see the method upbeat27 mention any problems, and more simple |
Then I will add @upbeat27 's solution. |
Fixed in |
* lib/fs_driver.py: add file system interface. * examples/Dynamic_loading_font_example.py: add font loading demo. * examples/font/*: add test font(Alibaba-PuHuiTi) * Adjust font example to run on the unix port
Hi kisvegabor,
I found the lv_area_is_on function implementation seems a bit of a problem, the comment right-top but the implementation is p.x = a2_p-> x1 should be p.x = a2_p-> x2;
And There are problems with the last two judgments, Because they are always fake:
((a2_p->y1 <= a1_p->y1 && a2_p->y1 >= a1_p->y2) ||
(a2_p->y2 <= a1_p->y1 && a2_p->y2 >= a1_p->y2) ||
(a2_p->y1 <= a1_p->y1 && a2_p->y2 >= a1_p->y2))
((a2_p->x1 <= a1_p->x1 && a2_p->x1 >= a1_p->x2) ||
(a2_p->x2 <= a1_p->x1 && a2_p->x2 >= a1_p->x2) ||
(a2_p->x1 <= a1_p->x1 && a2_p->x2 >= a1_p->x2))
The text was updated successfully, but these errors were encountered: