cogl-texture: Fix manual repeating for negative coordinates

When calculating the next integer position for negative coordinates it
would not increment if the position is already a multiple of one so we
need to manually add one.
This commit is contained in:
Neil Roberts 2010-01-11 16:23:38 +00:00
parent f1c289378e
commit 963afa88c5

View File

@ -228,12 +228,13 @@ static void
_cogl_texture_iter_update (CoglTextureIter *iter) _cogl_texture_iter_update (CoglTextureIter *iter)
{ {
gfloat t_2; gfloat t_2;
float frac_part;
modff (iter->pos, &iter->next_pos); frac_part = modff (iter->pos, &iter->next_pos);
/* modff rounds the int part towards zero so we need to add one if /* modff rounds the int part towards zero so we need to add one if
we're meant to be heading away from zero */ we're meant to be heading away from zero */
if (iter->pos >= 0.0f) if (iter->pos >= 0.0f || frac_part == 0.0f)
iter->next_pos += 1.0f; iter->next_pos += 1.0f;
if (iter->next_pos > iter->end) if (iter->next_pos > iter->end)