From fab973bedfca2be45ca03e26cbf0fad8c130037c Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 25 Nov 2005 15:40:28 +0000 Subject: Fix the change of type on angles. --- generic/Item.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'generic') diff --git a/generic/Item.c b/generic/Item.c index 4f1cdd8..5af67f6 100644 --- a/generic/Item.c +++ b/generic/Item.c @@ -734,10 +734,8 @@ ZnConfigureAttributes(ZnWInfo *wi, if (Tcl_GetDoubleFromObj(wi->interp, args[i+1], &angle) == TCL_ERROR) { return TCL_ERROR; } - if ((angle > 360) || (angle < -360)) { - angle = fmod(angle, 360.0); - } int_angle = (int) angle; + int_angle = int_angle % 360; if (int_angle != *((int *) valp)) { *((int *) valp) = int_angle; *flags |= desc->flags; @@ -919,10 +917,8 @@ ZnConfigureAttributes(ZnWInfo *wi, if (Tcl_GetIntFromObj(wi->interp, args[i+1], &integer) == TCL_ERROR) { return TCL_ERROR; } - if (desc->type == ZN_CONFIG_UINT) { - if (integer < 0) { + if ((desc->type == ZN_CONFIG_UINT) && (integer < 0)) { integer = 0; - } } if (integer != *((int *) valp)) { *((int *) valp) = integer; @@ -1219,6 +1215,7 @@ AttributeToObj(Tcl_Interp *interp, case ZN_CONFIG_UINT: return Tcl_NewIntObj(*((unsigned int *) valp)); case ZN_CONFIG_INT: + return Tcl_NewIntObj(*((int *) valp)); case ZN_CONFIG_ANGLE: return Tcl_NewDoubleObj(*((int *) valp)); case ZN_CONFIG_DIM: -- cgit v1.1