Author: spitzak Date: 2007-06-17 11:35:16 -0400 (Sun, 17 Jun 2007) New Revision: 5908 Log: Rectangle transform did a poor job due to float/int confusion
Modified: trunk/src/path.cxx Modified: trunk/src/path.cxx =================================================================== --- trunk/src/path.cxx 2007-06-15 20:40:45 UTC (rev 5907) +++ trunk/src/path.cxx 2007-06-17 15:35:16 UTC (rev 5908) @@ -298,9 +298,9 @@ float d1x,d1y; d1x = float(from.w()); d1y = 0; transform_distance(d1x, d1y); float d2x,d2y; d2x = 0; d2y = float(from.h()); transform_distance(d2x, d2y); float w = rintf(sqrtf(d1x*d1x+d2x*d2x)); - x = floorf(x - (w+1)/2); + x = floorf(x - w/2); float h = rintf(sqrtf(d1y*d1y+d2y*d2y)); - y = floorf(y - (h+1)/2); + y = floorf(y - h/2); to.set(int(x),int(y),int(w),int(h)); } @@ -320,8 +320,8 @@ float d2x,d2y; d2x = 0; d2y = float(H); transform_distance(d2x, d2y); W = int(sqrtf(d1x*d1x+d2x*d2x)+.5f); H = int(sqrtf(d1y*d1y+d2y*d2y)+.5f); - X = int(floorf(x - .5f*(W+1))); - Y = int(floorf(y - .5f*(H+1))); + X = int(floorf(x - .5f*W)); + Y = int(floorf(y - .5f*H)); } //////////////////////////////////////////////////////////////// _______________________________________________ fltk-commit mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-commit
