fix bug with incorrect pixel positioning and half texel offset