make input coordinates respect the viewport
This commit is contained in:
1 parent
190eb1f107
commit
dc2535358e
4 files changed
+34
-21
No files matched your search
+2
-2
@@ -45,8 +45,8 @@ static void update_action_pressed_state(InputState *input, Action *action) {
|
||||
else {
|
||||
action->just_changed = !action->is_pressed;
|
||||
action->is_pressed = true;
|
||||
action->position.x = (float)input->mouse_window_position.x;
|
||||
action->position.y = (float)input->mouse_window_position.y;
|
||||
action->position.x = ((float)input->mouse_window_position.x - ctx.viewport_rect.x) / ctx.viewport_scale;
|
||||
action->position.y = ((float)input->mouse_window_position.y - ctx.viewport_rect.y) / ctx.viewport_scale;
|
||||
|
||||
/* TODO: */
|
||||
/*
|
||||
|
||||
Reference in new issue
Block a user