From ba2fd8a9d354adad35af3e6ab67b9c04f37c2eb1 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 28 Jan 2009 12:57:06 +0000 Subject: [PATCH] [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. --- gl/cogl-texture.c | 4 ++-- gles/cogl-texture.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gl/cogl-texture.c b/gl/cogl-texture.c index 06ba7aece..2b25fafc0 100644 --- a/gl/cogl-texture.c +++ b/gl/cogl-texture.c @@ -2519,9 +2519,9 @@ _cogl_multitexture_unsliced_quad (float x_1, out_tex_coords[0] = out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size; 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] * (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] * (y_span->size - y_span->waste) / y_span->size; diff --git a/gles/cogl-texture.c b/gles/cogl-texture.c index 1300b1f9f..661af232f 100644 --- a/gles/cogl-texture.c +++ b/gles/cogl-texture.c @@ -2634,9 +2634,9 @@ _cogl_multitexture_unsliced_quad (float x1, out_tex_coords[0] = out_tex_coords[0] * (x_span->size - x_span->waste) / x_span->size; 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] * (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] * (y_span->size - y_span->waste) / y_span->size; }