diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-17 12:54:55 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-17 12:54:55 +0800 |
| commit | 0f8f98b9005803ab154b43dcad0db1f292072a4d (patch) | |
| tree | 0a43d5a9c4e3b747ad955fc30a143aa07ab5888d /src/ui/events/MouseEventArgs.cpp | |
| parent | b68f9f52a3ecdd8e379dd60ac1c1366e76695464 (diff) | |
| download | cru-0f8f98b9005803ab154b43dcad0db1f292072a4d.tar.gz cru-0f8f98b9005803ab154b43dcad0db1f292072a4d.tar.bz2 cru-0f8f98b9005803ab154b43dcad0db1f292072a4d.zip | |
Refactor window host.
Diffstat (limited to 'src/ui/events/MouseEventArgs.cpp')
| -rw-r--r-- | src/ui/events/MouseEventArgs.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ui/events/MouseEventArgs.cpp b/src/ui/events/MouseEventArgs.cpp index cad860d7..bbbf5cd4 100644 --- a/src/ui/events/MouseEventArgs.cpp +++ b/src/ui/events/MouseEventArgs.cpp @@ -1,7 +1,7 @@ #include "cru/ui/events/MouseEventArgs.h" #include "cru/ui/controls/Control.h" -#include "cru/ui/host/WindowHost.h" +#include "cru/ui/controls/Window.h" #include "cru/ui/render/RenderObject.h" namespace cru::ui::events { @@ -17,11 +17,9 @@ Point MouseEventArgs::GetPointToContent( Point MouseEventArgs::GetPointOfScreen() const { auto sender = GetSender(); if (auto control = dynamic_cast<controls::Control*>(sender)) { - if (auto host = control->GetWindowHost()) - return GetPoint() + control->GetWindowHost() - ->GetNativeWindow() - ->GetClientRect() - .GetLeftTop(); + if (auto window = control->GetWindow()) + return GetPoint() + + window->GetNativeWindow()->GetClientRect().GetLeftTop(); } return GetPoint(); } |
