Changeset 2734


Ignore:
Timestamp:
Aug 16, 2008, 3:16:19 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • img2rubik.c: improve stability by clipping t.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/examples/img2rubik.c

    r2733 r2734  
    423423            double t = (xp * (yb - ya) - yp * (xb - xa)) / (xa * yb - xb * ya);
    424424
     425            if(t > 1.0)
     426                t = 1.0;
     427
    425428            debug("    best RGB %g (%g,%g) (%g,%g)\n", t, xa, ya, xb, yb);
    426429
Note: See TracChangeset for help on using the changeset viewer.