_wip parent-child positioning fixes
This commit is contained in:
@@ -364,7 +364,10 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
Float2 GetMousePosition() const
|
||||
/// <summary>
|
||||
/// Returns the previous known position of the mouse before entering relative mode.
|
||||
/// </summary>
|
||||
Float2 GetOldMousePosition() const
|
||||
{
|
||||
return oldPosition;
|
||||
}
|
||||
@@ -480,6 +483,7 @@ bool SDLInput::HandleEvent(SDLWindow* window, SDL_Event& event)
|
||||
else
|
||||
{
|
||||
const Float2 mousePos = window->ClientToScreen({ event.motion.x, event.motion.y });
|
||||
LOG(Info, "motion {},{}, mouse: {}", event.motion.x, event.motion.y, mousePos);
|
||||
Input::Mouse->OnMouseMove(mousePos, window);
|
||||
}
|
||||
return true;
|
||||
@@ -509,7 +513,7 @@ bool SDLInput::HandleEvent(SDLWindow* window, SDL_Event& event)
|
||||
{
|
||||
// Use the previous visible mouse position here, the event or global
|
||||
// mouse position would cause input to trigger in other editor windows.
|
||||
mousePos = SDLInputImpl::Mouse->GetMousePosition();
|
||||
mousePos = SDLInputImpl::Mouse->GetOldMousePosition();
|
||||
}
|
||||
|
||||
if (event.button.state == SDL_RELEASED)
|
||||
@@ -531,7 +535,7 @@ bool SDLInput::HandleEvent(SDLWindow* window, SDL_Event& event)
|
||||
{
|
||||
// Use the previous visible mouse position here, the event or global
|
||||
// mouse position would cause input to trigger in other editor windows.
|
||||
mousePos = SDLInputImpl::Mouse->GetMousePosition();
|
||||
mousePos = SDLInputImpl::Mouse->GetOldMousePosition();
|
||||
}
|
||||
|
||||
Input::Mouse->OnMouseWheel(mousePos, delta, window);
|
||||
|
||||
Reference in New Issue
Block a user