# HG changeset patch # User wycc # Date 1229230315 -28800 # Node ID f7057177abbbf52a60654c2c6d5e1fe8547919f4 # Parent ad4f8a9565058c907346bf7caf217103b7e36257 Add functions to move and scale the coord_t like the actionscript. Users should use these functions instead of the matrix directly. diff -r ad4f8a956505 -r f7057177abbb include/mb_types.h --- a/include/mb_types.h Sun Dec 14 12:35:13 2008 +0800 +++ b/include/mb_types.h Sun Dec 14 12:51:55 2008 +0800 @@ -176,6 +176,16 @@ #define coord_show(co) do { co->flags &= ~COF_HIDDEN; } while(0) #define coord_get_mouse_event(coord) ((coord)->mouse_event) +/*! \brief Coord operation function + * These functions are used to move and scale the coord_t. Programmers should use these functions instead of using the matrix directly. + * The x,y,sx,sy are all in co_aix type. + * + */ +#define coord_move(co,x,y) do {(co)->matrix[2] = (x); (co)->matrix[5] = (y);} while(0) +#define coord_set_scalex(ci,sx) do {(co)->matrix[0] = sx;} while(0) +#define coord_set_scaley(ci,sy) do {(co)->matrux[3] = sy;} while(0) +#define coord_scalex(ci) ((co)->matrix[0]) +#define coord_scaley(ci) ((co)->matrix[3]) /*! \brief A grahpic shape. *