Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-04-01 02:09:43 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-04-01 02:09:43 +0400
commit4c36a26af5d1093badc88401bfebf8454fdf0f34 (patch)
tree2e82fc5ff893651982d20ffdd15d4c69bfcbe7b8 /source/blender/makesrna/intern/rna_access.c
parent3b711a6ed009b35bb69cd0ca878eeb8d55fa0e77 (diff)
parent8f949dd58decac45fd49f9a93152f2cddc98d901 (diff)
Merged changes in the trunk up to revision 45308.
Conflicts resolved: source/blender/editors/interface/resources.c source/blender/editors/mesh/editmesh_select.c source/blender/editors/space_view3d/drawobject.c
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c46
1 files changed, 30 insertions, 16 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index d2537f9fabd..d5363b33fe9 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -901,6 +901,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
{
IntPropertyRNA *iprop = (IntPropertyRNA*)rna_ensure_property(prop);
+ int softmin, softmax;
if (prop->magic != RNA_MAGIC) {
/* attempt to get the local ID values */
@@ -920,7 +921,10 @@ void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, in
}
if (iprop->range) {
- iprop->range(ptr, hardmin, hardmax);
+ *hardmin = INT_MIN;
+ *hardmax = INT_MAX;
+
+ iprop->range(ptr, hardmin, hardmax, &softmin, &softmax);
}
else {
*hardmin = iprop->hardmin;
@@ -953,14 +957,17 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin,
}
}
+ *softmin = iprop->softmin;
+ *softmax = iprop->softmax;
+
if (iprop->range) {
- iprop->range(ptr, &hardmin, &hardmax);
- *softmin = MAX2(iprop->softmin, hardmin);
- *softmax = MIN2(iprop->softmax, hardmax);
- }
- else {
- *softmin = iprop->softmin;
- *softmax = iprop->softmax;
+ hardmin = INT_MIN;
+ hardmax = INT_MAX;
+
+ iprop->range(ptr, &hardmin, &hardmax, softmin, softmax);
+
+ *softmin = MAX2(*softmin, hardmin);
+ *softmax = MIN2(*softmax, hardmax);
}
*step = iprop->step;
@@ -969,6 +976,7 @@ void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin,
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
{
FloatPropertyRNA *fprop = (FloatPropertyRNA*)rna_ensure_property(prop);
+ float softmin, softmax;
if (prop->magic != RNA_MAGIC) {
/* attempt to get the local ID values */
@@ -988,7 +996,10 @@ void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin
}
if (fprop->range) {
- fprop->range(ptr, hardmin, hardmax);
+ *hardmin = -FLT_MAX;
+ *hardmax = FLT_MAX;
+
+ fprop->range(ptr, hardmin, hardmax, &softmin, &softmax);
}
else {
*hardmin = fprop->hardmin;
@@ -1025,14 +1036,17 @@ void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *soft
}
}
+ *softmin = fprop->softmin;
+ *softmax = fprop->softmax;
+
if (fprop->range) {
- fprop->range(ptr, &hardmin, &hardmax);
- *softmin = MAX2(fprop->softmin, hardmin);
- *softmax = MIN2(fprop->softmax, hardmax);
- }
- else {
- *softmin = fprop->softmin;
- *softmax = fprop->softmax;
+ hardmin = -FLT_MAX;
+ hardmax = FLT_MAX;
+
+ fprop->range(ptr, &hardmin, &hardmax, softmin, softmax);
+
+ *softmin = MAX2(*softmin, hardmin);
+ *softmax = MIN2(*softmax, hardmax);
}
*step = fprop->step;