[Bf-blender-cvs] [39d1135] master: UI: fix minor glitch copying small float value
Campbell Barton
noreply at git.blender.org
Mon Dec 21 09:28:19 CET 2015
Commit: 39d11352e08cb3f8f0802275c67c847f64d8fd0b
Author: Campbell Barton
Date: Mon Dec 21 19:26:15 2015 +1100
Branches: master
https://developer.blender.org/rB39d11352e08cb3f8f0802275c67c847f64d8fd0b
UI: fix minor glitch copying small float value
Would copy 0.0 when button displayed 0.0000001.
===================================================================
M source/blender/editors/interface/interface_handlers.c
===================================================================
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 47dccd0..f71dcc0 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -2252,9 +2252,9 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
}
else if (mode == 'c') {
/* Get many decimal places, then strip trailing zeros.
- * note: too high values start to give strange results (6 or so is ok) */
+ * note: too high values start to give strange results */
char buf_copy[UI_MAX_DRAW_STR];
- ui_but_string_get_ex(but, buf_copy, sizeof(buf_copy), 6);
+ ui_but_string_get_ex(but, buf_copy, sizeof(buf_copy), UI_PRECISION_FLOAT_MAX);
BLI_str_rstrip_float_zero(buf_copy, '\0');
WM_clipboard_text_set(buf_copy, 0);
More information about the Bf-blender-cvs
mailing list