Merge pull request #33096 from jcs224/windows-screendrag-relative
Allow use of relative and speed properties for InputEventScreenDrag on Windows
This commit is contained in:
commit
4f0c05402f
1 changed files with 3 additions and 2 deletions
|
@ -288,15 +288,16 @@ void OS_Windows::_drag_event(float p_x, float p_y, int idx) {
|
||||||
if (curr->get() == Vector2(p_x, p_y))
|
if (curr->get() == Vector2(p_x, p_y))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
curr->get() = Vector2(p_x, p_y);
|
|
||||||
|
|
||||||
Ref<InputEventScreenDrag> event;
|
Ref<InputEventScreenDrag> event;
|
||||||
event.instance();
|
event.instance();
|
||||||
event->set_index(idx);
|
event->set_index(idx);
|
||||||
event->set_position(Vector2(p_x, p_y));
|
event->set_position(Vector2(p_x, p_y));
|
||||||
|
event->set_relative(Vector2(p_x, p_y) - curr->get());
|
||||||
|
|
||||||
if (main_loop)
|
if (main_loop)
|
||||||
input->accumulate_input_event(event);
|
input->accumulate_input_event(event);
|
||||||
|
|
||||||
|
curr->get() = Vector2(p_x, p_y);
|
||||||
};
|
};
|
||||||
|
|
||||||
LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
|
||||||
|
|
Loading…
Reference in a new issue