# HG changeset patch # User Thinker K.F. Li # Date 1252592642 -28800 # Node ID 115e7a936c94790ec878649b6de1ca0abb4b5fc4 # Parent 8b155b77fa144034e1ccebce02491bf3b1b74d0a Remove old sh_path_arc_path() code. - sh_path_arc_path() are replaced by the new code. diff -r 8b155b77fa14 -r 115e7a936c94 src/shape_path.c --- a/src/shape_path.c Thu Sep 10 22:21:51 2009 +0800 +++ b/src/shape_path.c Thu Sep 10 22:24:02 2009 +0800 @@ -372,86 +372,6 @@ *float_args_p = float_args; } -#if 0 -void __sh_path_arc_path(mbe_t *cr, const co_aix **args_p, - const int **fix_args_p) { - co_aix cx, cy, x0, y0, x, y; - co_aix dx, dy, dx0, dy0; - co_aix udxx, udxy; - co_aix xyratio; - co_aix rx; - co_aix rx2; - co_aix dra45x, dra45y, udra45x, udra45y; - co_aix rra45, rra45_2; - co_aix inner0, cross0; - co_aix inner, cross; - co_aix angle, angle0; - co_aix rotate; - co_aix _sqrt2; - const co_aix *args = *args_p; - const int *fix_args = *fix_args_p; - int sweep; - - _sqrt2 = sqrtf(2); - - x0 = *(args - 2); - y0 = *(args - 1); - cx = *args++; - cy = *args++; - ra45x = *args++; - ra45y = *args++; - x = *args++; - y = *args++; - sweep = *fix_args++; - - dx = x - cx; - dy = y - cy; - dx0 = x0 - cx; - dy0 = y0 - cy; - dra45x = ra45x - cx; - dra45y = ra45y - cy; - - rra45_2 = dra45x * dra45x + dra45y * dra45y; - rra45 = sqrtf(rra45_2); - udra45x = dra45x / rra45; - udra45y = dra45y / rra45; - - udxx = (udra45x + udra45y) * _sqrt2; - udxy = (-udra45x + udra45y) * _sqrt2; - - /*! \note Why we calculate these numbers there? - * If we compute it when filling arguments, _sh_path_arc_cmd_arg_fill(), - * we can avoid to recompute it for every drawing. But, transforming of - * coordinate can effect value of the numbers. - */ - rotate = acos(udxx); - if(udxy < 0) - rotate = 2 * PI - rotate; - - angle0 = angle_diff(udxx, udxy, dx0, dy0); - angle = angle_diff(udxx, udxy, dx, dy); - - ASSERT(rx != 0); - xyratio = udra45y / udra45x; - if(xyratio < 0) - xyratio = -xyratio; - - /* Make a path for arc */ - mbe_save(cr); - mbe_translate(cr, cx, cy); - mbe_rotate(cr, rotate); - mbe_scale(cr, 1.0, xyratio); - if(sweep) - mbe_arc(cr, 0, 0, rx, angle0, angle); - else - mbe_arc_negative(cr, 0, 0, rx, angle0, angle); - mbe_restore(cr); - - *args_p = args; - *fix_args_p = fix_args; -} -#endif - /* ============================================================ */ static void sh_path_free(shape_t *shape) {