diff options
author | lecoanet | 2005-11-25 15:40:28 +0000 |
---|---|---|
committer | lecoanet | 2005-11-25 15:40:28 +0000 |
commit | fab973bedfca2be45ca03e26cbf0fad8c130037c (patch) | |
tree | 1005a7edb43813a1c245dd5ae63ab06ac4f0447b | |
parent | 8ab47c77e620d05c3e8e4a41c6d7f32962e7c9be (diff) | |
download | tkzinc-fab973bedfca2be45ca03e26cbf0fad8c130037c.zip tkzinc-fab973bedfca2be45ca03e26cbf0fad8c130037c.tar.gz tkzinc-fab973bedfca2be45ca03e26cbf0fad8c130037c.tar.bz2 tkzinc-fab973bedfca2be45ca03e26cbf0fad8c130037c.tar.xz |
Fix the change of type on angles.
-rw-r--r-- | generic/Item.c | 9 |
1 files changed, 3 insertions, 6 deletions
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: |