Skip to content

Commit

Permalink
When retrieving dimensions, return the scaled size of the texture.
Browse files Browse the repository at this point in the history
  • Loading branch information
lipk committed Jun 17, 2014
1 parent 4bbdc09 commit c69b5a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sdl/texture.cpp
Expand Up @@ -289,15 +289,15 @@ int ttexture::width() const
int w;
SDL_QueryTexture(texture_,NULL, NULL, &w, NULL);

return w;
return w*hscale_;
}

int ttexture::height() const
{
int h;
SDL_QueryTexture(texture_,NULL, NULL, NULL, &h);

return h;
return h*vscale_;
}

SDL_Rect ttexture::dimensions() const
Expand All @@ -307,6 +307,8 @@ SDL_Rect ttexture::dimensions() const
dim.y = 0;
SDL_QueryTexture(texture_, NULL, NULL, &dim.w, &dim.h);

dim.w *= hscale_;
dim.h *= vscale_;
return dim;
}

Expand Down

0 comments on commit c69b5a3

Please sign in to comment.