From 89446084f356cc223d69305b2852c3d16da40500 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 5 Aug 2024 14:08:45 +0200 Subject: [PATCH] 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. --- repos/os/src/test/nitpicker/main.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repos/os/src/test/nitpicker/main.cc b/repos/os/src/test/nitpicker/main.cc index 11f828f7c5..4ad1597e2c 100644 --- a/repos/os/src/test/nitpicker/main.cc +++ b/repos/os/src/test/nitpicker/main.cc @@ -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]; } };