From 62e62ea8662b533692802ff72ac5156dba9b4d4a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 12 Nov 2008 15:52:12 +0000 Subject: [PATCH 1/1] (x_set_alpha): Set alpha to -1 if nil given. --- src/frame.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/frame.c b/src/frame.c index 6704e9f67c..722cf2f96a 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3654,25 +3654,24 @@ x_set_alpha (f, arg, oldval) else item = arg; - if (! NILP (item)) - { - if (FLOATP (item)) - { - alpha = XFLOAT_DATA (item); - if (alpha < 0.0 || 1.0 < alpha) - args_out_of_range (make_float (0.0), make_float (1.0)); - } - else if (INTEGERP (item)) - { - ialpha = XINT (item); - if (ialpha < 0 || 100 < ialpha) - args_out_of_range (make_number (0), make_number (100)); - else - alpha = ialpha / 100.0; - } - else - wrong_type_argument (Qnumberp, item); - } + if (NILP (item)) + alpha = - 1.0; + else if (FLOATP (item)) + { + alpha = XFLOAT_DATA (item); + if (alpha < 0.0 || 1.0 < alpha) + args_out_of_range (make_float (0.0), make_float (1.0)); + } + else if (INTEGERP (item)) + { + ialpha = XINT (item); + if (ialpha < 0 || 100 < ialpha) + args_out_of_range (make_number (0), make_number (100)); + else + alpha = ialpha / 100.0; + } + else + wrong_type_argument (Qnumberp, item); newval[i] = alpha; } -- 2.20.1