Mercurial > MadButterfly
changeset 460:115e7a936c94
Remove old sh_path_arc_path() code.
- sh_path_arc_path() are replaced by the new code.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Thu, 10 Sep 2009 22:24:02 +0800 |
parents | 8b155b77fa14 |
children | 61a0bceb369d |
files | src/shape_path.c |
diffstat | 1 files changed, 0 insertions(+), 80 deletions(-) [+] |
line wrap: on
line diff
--- 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) {