diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Item.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/generic/Item.c b/generic/Item.c index d1d6962..5935917 100644 --- a/generic/Item.c +++ b/generic/Item.c @@ -1110,9 +1110,17 @@ AttributeToObj(ZnWInfo *wi, str = Tk_PathName(*((Tk_Window *) valp)); } break; - case ZN_CONFIG_INT: - case ZN_CONFIG_UINT: + case ZN_CONFIG_USHORT: case ZN_CONFIG_PRI: + Tcl_SetIntObj(result, *((unsigned short *) valp)); + return; + case ZN_CONFIG_SHORT: + Tcl_SetIntObj(result, *((short *) valp)); + return; + case ZN_CONFIG_UINT: + Tcl_SetIntObj(result, *((unsigned int *) valp)); + return; + case ZN_CONFIG_INT: case ZN_CONFIG_ANGLE: case ZN_CONFIG_ALPHA: Tcl_SetIntObj(result, *((int *) valp)); @@ -1752,7 +1760,7 @@ QueryItem(ZnItem item, ********************************************************************************** * * ComposeTransform -- - * Compose a (item) transform with current_t in new_t. + * Compose a transform transfo with current_t to new_t. * ********************************************************************************** */ @@ -1779,29 +1787,25 @@ ComposeTransform(ZnTransfo *transfo, ZnTransfoCompose(new_t, transfo, current_t); } else { - ZnPoint scale, trans, local_scale, local_trans; + ZnPoint scale, trans, local_scale, local_trans, p, p2; ZnReal local_rot, rot; ZnTransfo t, t2; - /* - * Need to decompose the local transform in translation, - * rotation and scale. - */ - ZnTransfoSetIdentity(&t); ZnTransfoSetIdentity(new_t); ZnTransfoDecompose(transfo, &local_scale, &local_trans, &local_rot, NULL); - ZnTranslate(&t, local_trans.x, local_trans.y); - ZnTransfoCompose(&t2, &t, current_t); - ZnTransfoDecompose(&t2, &scale, &trans, &rot, NULL); + ZnScale(new_t, local_scale.x, local_scale.y); + ZnRotateRad(new_t, local_rot); + ZnTransfoDecompose(current_t, &scale, &trans, &rot, NULL); + + ZnTransformPoint(current_t, &local_trans, &p2); + if (compose_scale) { ZnScale(new_t, scale.x, scale.y); } if (compose_rot) { ZnRotateRad(new_t, rot); } - ZnScale(new_t, local_scale.x, local_scale.y); - ZnRotateRad(new_t, local_rot); - ZnTranslate(new_t, trans.x, trans.y); + ZnTranslate(new_t, p2.x, p2.y); } } |