mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:17:35 +00:00
LibWeb: Make hit testing functions return Optional<HitTestResult>
Using "HitTestResult with null paintable" as a way to signal misses was unnecessarily confusing. Let's use Optional instead. :^)
This commit is contained in:
parent
8c88ee1165
commit
0ba785894c
7 changed files with 50 additions and 44 deletions
|
@ -22,7 +22,7 @@ enum class PaintPhase {
|
|||
};
|
||||
|
||||
struct HitTestResult {
|
||||
RefPtr<Painting::Paintable> paintable;
|
||||
NonnullRefPtr<Painting::Paintable> paintable;
|
||||
int index_in_node { 0 };
|
||||
|
||||
enum InternalPosition {
|
||||
|
@ -50,7 +50,7 @@ public:
|
|||
virtual void before_children_paint(PaintContext&, PaintPhase) const { }
|
||||
virtual void after_children_paint(PaintContext&, PaintPhase) const { }
|
||||
|
||||
virtual HitTestResult hit_test(Gfx::FloatPoint const&, HitTestType) const;
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const;
|
||||
|
||||
virtual bool wants_mouse_events() const { return false; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue