From 39d11352e08cb3f8f0802275c67c847f64d8fd0b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 21 Dec 2015 19:26:15 +1100 Subject: [PATCH] UI: fix minor glitch copying small float value Would copy 0.0 when button displayed 0.0000001. --- source/blender/editors/interface/interface_handlers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 47dccd072c2..f71dcc06933 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);