diff -r ddbca09f8f9d -r d4146a4beed3 src/render/direct3d/SDL_render_d3d.c --- a/src/render/direct3d/SDL_render_d3d.c Fri Jul 18 14:10:45 2014 -0700 +++ b/src/render/direct3d/SDL_render_d3d.c Tue Jul 22 19:28:29 2014 +0430 @@ -1671,29 +1671,27 @@ centerx = center->x; centery = center->y; - if (flip & SDL_FLIP_HORIZONTAL) { - minx = dstrect->w - centerx - 0.5f; - maxx = -centerx - 0.5f; - } - else { - minx = -centerx - 0.5f; - maxx = dstrect->w - centerx - 0.5f; - } - - if (flip & SDL_FLIP_VERTICAL) { - miny = dstrect->h - centery - 0.5f; - maxy = -centery - 0.5f; - } - else { - miny = -centery - 0.5f; - maxy = dstrect->h - centery - 0.5f; - } + minx = -centerx; + maxx = dstrect->w - centerx; + miny = -centery; + maxy = dstrect->h - centery; minu = (float) srcrect->x / texture->w; maxu = (float) (srcrect->x + srcrect->w) / texture->w; minv = (float) srcrect->y / texture->h; maxv = (float) (srcrect->y + srcrect->h) / texture->h; + if (flip & SDL_FLIP_HORIZONTAL) { + float tmp = maxu; + maxu = minu; + minu = tmp; + } + if (flip & SDL_FLIP_VERTICAL) { + float tmp = maxv; + maxv = minv; + minv = tmp; + } + color = D3DCOLOR_ARGB(texture->a, texture->r, texture->g, texture->b); vertices[0].x = minx; @@ -1729,8 +1727,8 @@ /* Rotate and translate */ modelMatrix = MatrixMultiply( MatrixRotationZ((float)(M_PI * (float) angle / 180.0f)), - MatrixTranslation(dstrect->x + center->x, dstrect->y + center->y, 0) -); + MatrixTranslation(dstrect->x + center->x - 0.5f, dstrect->y + center->y - 0.5f, 0) + ); IDirect3DDevice9_SetTransform(data->device, D3DTS_VIEW, (D3DMATRIX*)&modelMatrix); D3D_UpdateTextureScaleMode(data, texturedata, 0); diff -r ddbca09f8f9d -r d4146a4beed3 src/render/direct3d11/SDL_render_d3d11.c --- a/src/render/direct3d11/SDL_render_d3d11.c Fri Jul 18 14:10:45 2014 -0700 +++ b/src/render/direct3d11/SDL_render_d3d11.c Tue Jul 22 19:28:29 2014 +0430 @@ -2728,7 +2728,7 @@ modelMatrix = MatrixMultiply( MatrixRotationZ((float)(M_PI * (float) angle / 180.0f)), - MatrixTranslation(dstrect->x + center->x, dstrect->y + center->y, 0) + MatrixTranslation(dstrect->x + center->x - 0.5f, dstrect->y + center->y - 0.5f, 0) ); D3D11_SetModelMatrix(renderer, &modelMatrix);