Is there any chance to rewrite setTextureRect() function to accept FloatRect?
I have written a simple shader that adds a cheap antialiasing to the sprite edges. Before running the shader I extend the sprite size by 1 pixel on each side and pass those dimensions to the shader, but what I also need is to adjust the texture uv to shrink by 1 pixel, but in screen resolution, not texture resolution. setTextureRect() is quantised to texture resolution, so if the sprite is stretched the border size I added does not match the modified texture uvs.
Here is the AA shader
uniform sampler2D texture;
uniform vec2 size; // sprite size, not texture size
void main()
{
vec2 coords = gl_TexCoord[0].xy;
float aa_edge = length( max( abs( coords * size - size / 2.0 ) - ( size / 2.0 - vec2( 1.5, 1.5 )), 0.0 ));
vec4 pixel = texture2D( texture, gl_TexCoord[0].xy );
gl_FragColor = gl_Color * pixel;
gl_FragColor.w = gl_Color.w * ( 1.0 - aa_edge );
}