[cogl-texture] Fix order of tex coords when compensating for waste

When drawing a texture with waste in _cogl_multitexture_unsliced_quad
it scales the texture coordinates so that the waste is not
included. However the formula was the wrong way around so it was
calculating as if the texture coordinates are ordered x1,x2,y1,y2 but
it is actually x1,y1,x2,y2.
This commit is contained in:
Neil Roberts 2009-01-28 12:57:06 +00:00
parent 561c441241
commit d7c275f5e5
2 changed files with 4 additions and 4 deletions

View File

@ -2519,9 +2519,9 @@ _cogl_multitexture_unsliced_quad (float x_1,
out_tex_coords[0] = out_tex_coords[0] =
out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size; out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size;
out_tex_coords[1] = out_tex_coords[1] =
out_tex_coords[1] * (x_span->size - x_span->waste) / x_span->size; out_tex_coords[1] * (y_span->size - y_span->waste) / y_span->size;
out_tex_coords[2] = out_tex_coords[2] =
out_tex_coords[2] * (y_span->size - y_span->waste) / y_span->size; out_tex_coords[2] * (x_span->size - x_span->waste) / x_span->size;
out_tex_coords[3] = out_tex_coords[3] =
out_tex_coords[3] * (y_span->size - y_span->waste) / y_span->size; out_tex_coords[3] * (y_span->size - y_span->waste) / y_span->size;

View File

@ -2634,9 +2634,9 @@ _cogl_multitexture_unsliced_quad (float x1,
out_tex_coords[0] = out_tex_coords[0] =
out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size; out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size;
out_tex_coords[1] = out_tex_coords[1] =
out_tex_coords[1] * (x_span->size - x_span->waste) / x_span->size; out_tex_coords[1] * (y_span->size - y_span->waste) / y_span->size;
out_tex_coords[2] = out_tex_coords[2] =
out_tex_coords[2] * (y_span->size - y_span->waste) / y_span->size; out_tex_coords[2] * (x_span->size - x_span->waste) / x_span->size;
out_tex_coords[3] = out_tex_coords[3] =
out_tex_coords[3] * (y_span->size - y_span->waste) / y_span->size; out_tex_coords[3] * (y_span->size - y_span->waste) / y_span->size;
} }