diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-01-01 13:39:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-01-01 13:39:43 +0400 |
commit | 2c072d8f85fe38e3188813dd09147d1d32c775b5 (patch) | |
tree | 1543955ea10360b4c4b6953214bf2b633e08adc5 /source/blender/makesrna/intern/makesrna.c | |
parent | f01ac19c3c720505b35aca520935845e9c8af862 (diff) |
rna api - set hard min/max for colors which are float properties but internally use chars to 0/1.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index e0771dbedb7..0a67aa6e65e 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -448,11 +448,9 @@ static int rna_enum_bitmask(PropertyRNA *prop) static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp) { - if(prop->type == PROP_FLOAT && (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA)) - if(strcmp(dp->dnatype, "float") != 0 && strcmp(dp->dnatype, "double") != 0) - return 1; - - return 0; + return ( (prop->type == PROP_FLOAT) && + (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA) && + (IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) ); } static const char *rna_function_string(void *func) |