copying values from int buttons were adding floating point 0.00000's
authorCampbell Barton <ideasman42@gmail.com>
Wed, 21 Apr 2010 21:43:29 +0000 (21:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 21 Apr 2010 21:43:29 +0000 (21:43 +0000)
source/blender/editors/interface/interface_handlers.c

index 258a9e545106b452ad91e02fa67d1e8e3f3b4df9..8aeca23a188e43eb36642506c446a180815cf149 100644 (file)
@@ -1004,7 +1004,11 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
                
                if(but->poin==NULL && but->rnapoin.data==NULL);
                else if(mode=='c') {
-                       sprintf(buf, "%f", ui_get_but_val(but));
+                       if(ui_is_but_float(but))
+                               sprintf(buf, "%f", ui_get_but_val(but));
+                       else
+                               sprintf(buf, "%d", (int)ui_get_but_val(but));
+
                        WM_clipboard_text_set(buf, 0);
                }
                else {