Attempted fixes for color picker trouble (can't reproduce here..)
authorMatt Ebb <matt@mke3.net>
Tue, 30 Mar 2010 12:43:39 +0000 (12:43 +0000)
committerMatt Ebb <matt@mke3.net>
Tue, 30 Mar 2010 12:43:39 +0000 (12:43 +0000)
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c

index 63a3cf78edad970538ba8833e7d544962c45db18..b9cb83b4ebb1c422d93da51e0dc34aa9f4a0b88d 100644 (file)
@@ -2902,8 +2902,7 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
                float range;
                
                /* vertical 'value' strip */
-               hsv[2]= y; 
-               
+
                /* exception only for value strip - use the range set in but->min/max */
                range = but->softmax - but->softmin;
                hsv[2] = y*range + but->softmin;
@@ -2914,7 +2913,7 @@ static int ui_numedit_but_HSVCUBE(uiBut *but, uiHandleButtonData *data, int mx,
        }
 
        hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
-       ui_set_but_vectorf(but, rgb);
+       copy_v3_v3(data->vec, rgb);
 
        data->draglastx= mx;
        data->draglasty= my;
index 7f70bfe335a3fc85c61270e163724815c8567aa1..35add45b10a096c663bde51220a6fd9cce293c61 100644 (file)
@@ -1736,11 +1736,11 @@ static void circle_picker(uiBlock *block, PointerRNA *ptr, const char *propname)
        uiBut *bt;
        
        /* HS circle */
-       bt= uiDefButR(block, HSVCIRCLE, 0, "",  0, 0, PICKER_H, PICKER_W, ptr, propname, -1, 0.0, 0.0, 0, 0, "");
+       bt= uiDefButR(block, HSVCIRCLE, 0, "",  0, 0, PICKER_H, PICKER_W, ptr, propname, 0, 0.0, 0.0, 0, 0, "");
        uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
        
        /* value */
-       bt= uiDefButR(block, HSVCUBE, 0, "", PICKER_W+PICKER_SPACE,0,PICKER_BAR,PICKER_H, ptr, propname, -1, 0.0, 0.0, UI_GRAD_V_ALT, 0, "");
+       bt= uiDefButR(block, HSVCUBE, 0, "", PICKER_W+PICKER_SPACE,0,PICKER_BAR,PICKER_H, ptr, propname, 0, 0.0, 0.0, UI_GRAD_V_ALT, 0, "");
        uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
 }
 
@@ -1751,11 +1751,11 @@ static void square_picker(uiBlock *block, PointerRNA *ptr, const char *propname,
        int bartype = type + 3;
        
        /* HS square */
-       bt= uiDefButR(block, HSVCUBE, 0, "",    0, PICKER_BAR+PICKER_SPACE, PICKER_TOTAL_W, PICKER_H, ptr, propname, -1, 0.0, 0.0, type, 0, "");
+       bt= uiDefButR(block, HSVCUBE, 0, "",    0, PICKER_BAR+PICKER_SPACE, PICKER_TOTAL_W, PICKER_H, ptr, propname, 0, 0.0, 0.0, type, 0, "");
        uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
        
        /* value */
-       bt= uiDefButR(block, HSVCUBE, 0, "",            0, 0, PICKER_TOTAL_W, PICKER_BAR, ptr, propname, -1, 0.0, 0.0, bartype, 0, "");
+       bt= uiDefButR(block, HSVCUBE, 0, "",            0, 0, PICKER_TOTAL_W, PICKER_BAR, ptr, propname, 0, 0.0, 0.0, bartype, 0, "");
        uiButSetFunc(bt, do_picker_rna_cb, bt, NULL);
 }