test/nitpicker: fix interaction in non-alpha mode

Commit "gui_session,nitpicker,testnit: update coding style" broke the
user-input handling of the test when configured w/o alpha.
This commit is contained in:
Norman Feske 2024-08-05 14:08:45 +02:00 committed by Christian Helmuth
parent d40f9b712e
commit 89446084f3

View File

@ -149,8 +149,10 @@ class Test::View_stack : Noncopyable
*/
bool hit(Gui::Point const at) const
{
return ptr
&& Rect(Point(0, 0), size).contains(at)
if (!ptr)
return true;
return Rect(Point(0, 0), size).contains(at)
&& ptr[size.w*at.y + at.x];
}
};