aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/Item.c9
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: