From b844653c649277eed63b6a85d29b84aab8abe641 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 11 Jan 2010 16:23:38 +0000 Subject: [PATCH] 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. --- clutter/cogl/cogl/cogl-texture.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clutter/cogl/cogl/cogl-texture.c b/clutter/cogl/cogl/cogl-texture.c index c1bae7a..85a6de7 100644 --- a/clutter/cogl/cogl/cogl-texture.c +++ b/clutter/cogl/cogl/cogl-texture.c @@ -228,12 +228,13 @@ static void _cogl_texture_iter_update (CoglTextureIter *iter) { 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 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; if (iter->next_pos > iter->end) -- 2.7.4