Mercurial > MadButterfly
changeset 222:f7057177abbb
Add functions to move and scale the coord_t like the actionscript. Users should use these functions instead of the matrix directly.
author | wycc |
---|---|
date | Sun, 14 Dec 2008 12:51:55 +0800 |
parents | ad4f8a956505 |
children | 8be36a0d4239 |
files | include/mb_types.h |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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. *