Skip to content

Commit

Permalink
mouse mouse_get_rel: Fix for SCALED
Browse files Browse the repository at this point in the history
  • Loading branch information
René Dudfield committed Mar 17, 2023
1 parent c88f854 commit ca4aea3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src_c/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ mouse_get_rel(PyObject *self, PyObject *_null)
VIDEO_INIT_CHECK();

SDL_GetRelativeMouseState(&x, &y);

/*
{
SDL_Window *sdlWindow = pg_GetDefaultWindow();
SDL_Renderer *sdlRenderer = SDL_GetRenderer(sdlWindow);
if (sdlRenderer!=NULL){
if (sdlRenderer != NULL) {
SDL_Rect vprect;
float scalex, scaley;

SDL_RenderGetScale(sdlRenderer, &scalex, &scaley);
x/=scalex;
y/=scaley;
SDL_RenderGetViewport(sdlRenderer, &vprect);
x = (int)(x * scalex + vprect.x);
y = (int)(y * scaley + vprect.y);
}
*/
}
return pg_tuple_couple_from_values_int(x, y);
}

Expand Down

0 comments on commit ca4aea3

Please sign in to comment.