mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:27:34 +00:00
WindowServer: Make hit test results richer
Instead of just answering hit/no-hit when hit testing windows, we now return a HitTestResult object which tells you which window was hit, where it was hit, and whether you hit the frame or the content.
This commit is contained in:
parent
370d3749e5
commit
4133caba78
6 changed files with 91 additions and 45 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "HitTestResult.h"
|
||||
#include <AK/String.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibCore/Object.h>
|
||||
|
@ -138,7 +139,7 @@ public:
|
|||
{
|
||||
m_alpha_hit_threshold = threshold;
|
||||
}
|
||||
bool hit_test(const Gfx::IntPoint&, bool include_frame = true) const;
|
||||
Optional<HitTestResult> hit_test(const Gfx::IntPoint&, bool include_frame = true) const;
|
||||
|
||||
int x() const { return m_rect.x(); }
|
||||
int y() const { return m_rect.y(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue