From 003be8aa7c6d837d43bdadb99f60cd5f6dca72bd Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 16 Jan 2020 12:08:17 +0100 Subject: UI: Use same precision in "Move" redo panel as elsewhere The floating "Move" redo panel showed transform values with less precision than in other places (e.g. sidebar and properties editor). With Millimeters as unit it would even round to full integers, which may be an issue since you typically work at higher precisions with this unit. Note that this only applies to the visual precision, internally we use full floating point `float`s still. Fixes T70367. --- source/blender/makesrna/intern/rna_define.c | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'source/blender/makesrna/intern/rna_define.c') diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 55aa529a30e..73a59cbba11 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -3888,6 +3888,36 @@ PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, return prop; } +PropertyRNA *RNA_def_float_translation(StructOrFunctionRNA *cont_, + const char *identifier, + int len, + const float *default_value, + float hardmin, + float hardmax, + const char *ui_name, + const char *ui_description, + float softmin, + float softmax) +{ + PropertyRNA *prop; + + prop = RNA_def_float_vector(cont_, + identifier, + len, + default_value, + hardmin, + hardmax, + ui_name, + ui_description, + softmin, + softmax); + prop->subtype = PROP_TRANSLATION; + + RNA_def_property_ui_range(prop, softmin, softmax, 1, RNA_TRANSLATION_PREC_DEFAULT); + + return prop; +} + PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont_, const char *identifier, int len, -- cgit v1.2.3