libs/libnx/nxglib/nxglib_intersecting.c: Correct bogus logic in nxgl_interesting. Good to know I was stupid then to and that is it not just a recent thing.

This commit is contained in:
Gregory Nutt 2019-05-13 09:06:14 -06:00
parent 4f31eec94e
commit f371679f58
2 changed files with 5 additions and 4 deletions

View File

@ -852,7 +852,7 @@ nxwm
the serial console. So I do not believe that problem exists and
I think that the above workaround should no longer be necessary.
However, I will leave the above text in place until I get then
oppotunity to verify that the new UART simulation fixes the problem.
opportunity to verify that the new UART simulation fixes the problem.
2019-05-04: Something has changed. Today this configuration failed
to build because is requires CONFIG_NX_XYINPUT=y in the configuration.

View File

@ -58,7 +58,8 @@
bool nxgl_intersecting(FAR const struct nxgl_rect_s *rect1,
FAR const struct nxgl_rect_s *rect2)
{
return ((rect1->pt2.x > rect2->pt1.x) && (rect1->pt2.y > rect2->pt1.y) &&
(rect1->pt1.x < rect2->pt2.x) && (rect1->pt1.y < rect2->pt1.y));
return ((ngl_max(rect1->pt1.x, rect2->pt1.x) <=
ngl_min(rect1->pt2.x, rect2->pt2.x)) &&
(ngl_max(rect1->pt1.y, rect2->pt1.y) <=
ngl_min(rect1->pt2.y, rect2->pt2.y)));
}