single surface - not quite pixel perfect?

Blitz3D Forums/Blitz3D Programming/single surface - not quite pixel perfect?

In my single surface system, I can't seem to get it pixel perfect. To all intents and purposes it is the correct size but the left hand side of a quad tends to fade to black.

When two identical quads are placed side by side, this results in a visible gap between them, which I don't want.

At the minute I've used a get-around by making the quads slightly longer on the horizontal - one pixel each side. This removes the fade but means a slightly elongated texture on the quad. For the most part this is invisible, yet the perfectionist in me isn't happy.

Is there anything I can do?

Function E2_drawSprite(this.sprite, xpos#, ypos#, xscale#, yscale#, angle#, alpha#)
	
	;get x and y distances from centre
	angle = 360-angle
	xdist# = (((this\width))/2.0)*xscale
	ydist# = (((this\height))/2.0)*yscale
	
	;rotate each vertex in turn
	x1# = (xdist*-1) * Cos(angle) - ydist * Sin(angle) - 1
	y1# = (xdist*-1) * Sin(angle) + ydist * Cos(angle)
	
	x2# = xdist * Cos(angle) - ydist * Sin(angle) + 1
	y2# = xdist * Sin(angle) + ydist * Cos(angle)
	
	x3# = xdist * Cos(angle) + ydist * Sin(angle) + 1
	y3# = xdist * Sin(angle) - ydist * Cos(angle)
	
	x4# = (xdist*-1) * Cos(angle) + ydist * Sin(angle) - 1
	y4# = (xdist*-1) * Sin(angle) - ydist * Cos(angle)

	;create the four vertices as part of the quad.
	v1 = AddVertex(mainSurface, xpos+x1, ypos+y1, 0, this\u1, this\v1)
	v2 = AddVertex(mainSurface, xpos+x2, ypos+y2, 0, this\u2, this\v1)
	v3 = AddVertex(mainSurface, xpos+x3, ypos+y3, 0, this\u2, this\v2)
	v4 = AddVertex(mainSurface, xpos+x4, ypos+y4, 0, this\u1, this\v2)
	
	VertexColor mainSurface, v1, 255, 255, 255, alpha
	VertexColor mainSurface, v2, 255, 255, 255, alpha
	VertexColor mainSurface, v3, 255, 255, 255, alpha
	VertexColor mainSurface, v4, 255, 255, 255, alpha
	
	;add two triangles
	t1 = AddTriangle(mainSurface, v1, v2, v4)
	t2 = AddTriangle(mainSurface, v2, v3, v4)

End Function