diff options
author | Andreas Haas <liu.gam3@gmail.com> | 2017-06-03 10:54:24 +0200 |
---|---|---|
committer | Andreas Haas <liu.gam3@gmail.com> | 2017-06-03 11:26:39 +0200 |
commit | 9bc534896135322a578118f433f0dc6265839082 (patch) | |
tree | 30316ffea9d6321c6b8292a02b6db3dac9cd1053 /platform/windows | |
parent | 5a6d4971e13157cc5f0de199de7f6d257070fc66 (diff) |
InputEvent: Renamed "pos" property to "position"
Make the naming consistent with other classes.
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/os_windows.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 830aae5515..5d1393ed51 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -219,7 +219,7 @@ void OS_Windows::_touch_event(bool p_pressed, int p_x, int p_y, int idx) { event.instance(); event->set_index(idx); event->set_pressed(p_pressed); - event->set_pos(Vector2(p_x, p_y)); + event->set_position(Vector2(p_x, p_y)); if (main_loop) { input->parse_input_event(event); @@ -231,7 +231,7 @@ void OS_Windows::_drag_event(int p_x, int p_y, int idx) { Ref<InputEventScreenDrag> event; event.instance(); event->set_index(idx); - event->set_pos(Vector2(p_x, p_y)); + event->set_position(Vector2(p_x, p_y)); if (main_loop) input->parse_input_event(event); @@ -378,7 +378,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) last_button_state = mm->get_button_mask(); /*mm->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0; mm->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/ - mm->set_pos(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); + mm->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); if (mouse_mode == MOUSE_MODE_CAPTURED) { @@ -386,31 +386,31 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) old_x = c.x; old_y = c.y; - if (mm->get_pos() == c) { + if (mm->get_position() == c) { center = c; return 0; } - Point2i ncenter = mm->get_pos(); + Point2i ncenter = mm->get_position(); center = ncenter; POINT pos = { (int)c.x, (int)c.y }; ClientToScreen(hWnd, &pos); SetCursorPos(pos.x, pos.y); } - input->set_mouse_position(mm->get_pos()); + input->set_mouse_position(mm->get_position()); mm->set_speed(input->get_last_mouse_speed()); if (old_invalid) { - old_x = mm->get_pos().x; - old_y = mm->get_pos().y; + old_x = mm->get_position().x; + old_y = mm->get_position().y; old_invalid = false; } - mm->set_relative(Vector2(mm->get_pos() - Vector2(old_x, old_y))); - old_x = mm->get_pos().x; - old_y = mm->get_pos().y; + mm->set_relative(Vector2(mm->get_position() - Vector2(old_x, old_y))); + old_x = mm->get_position().x; + old_y = mm->get_position().y; if (window_has_focus && main_loop) input->parse_input_event(mm); @@ -536,14 +536,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* mb->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0; mb->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/ - mb->set_pos(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); + mb->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam))); if (mouse_mode == MOUSE_MODE_CAPTURED) { - mb->set_pos(Vector2(old_x, old_y)); + mb->set_position(Vector2(old_x, old_y)); } - mb->set_global_pos(mb->get_pos()); + mb->set_global_position(mb->get_position()); if (uMsg != WM_MOUSEWHEEL) { if (mb->is_pressed()) { @@ -560,12 +560,12 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } else if (mouse_mode != MOUSE_MODE_CAPTURED) { // for reasons unknown to mankind, wheel comes in screen cordinates POINT coords; - coords.x = mb->get_pos().x; - coords.y = mb->get_pos().y; + coords.x = mb->get_position().x; + coords.y = mb->get_position().y; ScreenToClient(hWnd, &coords); - mb->set_pos(Vector2(coords.x, coords.y)); + mb->set_position(Vector2(coords.x, coords.y)); } if (main_loop) { |