diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/Color.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/generic/Color.c b/generic/Color.c index ed2d17f..4863b52 100644 --- a/generic/Color.c +++ b/generic/Color.c @@ -889,15 +889,8 @@ ZnGetGradient(Tcl_Interp *interp, next_ptr = strchr(scan_ptr, '|'); if (*scan_ptr == '=') { scan_ptr++; - if (((*scan_ptr == 'a') && (strncmp(scan_ptr, "axial", 5) == 0)) || - ((*scan_ptr == 'c') && (strncmp(scan_ptr, "conical", 7) == 0))) { - if (*scan_ptr == 'a') { - scan_ptr += 5; - } - else { - scan_ptr += 7; - type = ZN_CONICAL_GRADIENT; - } + if ((*scan_ptr == 'a') && (strncmp(scan_ptr, "axial", 5) == 0)) { + scan_ptr += 5; num_coords = ParseRealList(scan_ptr, next_ptr, coords, 4); if ((num_coords != 1) && (num_coords != 4)) { grad_err3: @@ -905,7 +898,16 @@ ZnGetGradient(Tcl_Interp *interp, desc, "\",", NULL); goto grad_err1; } - angle = (init) coords[0]; + angle = (int) coords[0]; + } + else if ((*scan_ptr == 'c') && (strncmp(scan_ptr, "conical", 7) == 0)) { + scan_ptr += 7; + type = ZN_CONICAL_GRADIENT; + num_coords = ParseRealList(scan_ptr, next_ptr, coords, 4); + if ((num_coords != 1) && (num_coords != 3) && (num_coords != 4)) { + goto grad_err3; + } + angle = (int) coords[0]; } else if (((*scan_ptr == 'r') && (strncmp(scan_ptr, "radial", 6) == 0)) || ((*scan_ptr == 'p') && (strncmp(scan_ptr, "path", 4) == 0))) { @@ -950,6 +952,11 @@ ZnGetGradient(Tcl_Interp *interp, grad->e.x = coords[2]; grad->e.y = coords[3]; } + else if ((type == ZN_CONICAL_GRADIENT) && (num_coords == 3)) { + grad->p.x = coords[0]; + grad->p.y = coords[1]; + grad->angle = (int) coords[2]; + } else { grad->angle = (int) angle; } |