diff options
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index c54b062c815..d6357f392b5 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. @@ -1189,6 +1189,12 @@ void ui_get_but_vectorf(uiBut *but, float *vec) float *fp= (float *)but->poin; VECCOPY(vec, fp); } + else { + if (but->editvec==NULL) { + fprintf(stderr, "ui_get_but_vectorf: can't get color, should never happen\n"); + vec[0]= vec[1]= vec[2]= 0.0f; + } + } } /* for buttons pointing to color for example */ @@ -2096,6 +2102,15 @@ void ui_check_but(uiBut *but) strncpy(but->drawstr+2, but->str, UI_MAX_DRAW_STR-2); } break; + + case HSVCUBE: + case HSVCIRCLE: + { + float rgb[3]; + ui_get_but_vectorf(but, rgb); + rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); + } + break; default: strncpy(but->drawstr, but->str, UI_MAX_DRAW_STR); @@ -2361,13 +2376,6 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short } } } - - if(ELEM(but->type, HSVCUBE, HSVCIRCLE)) { /* hsv buttons temp storage */ - float rgb[3]; - ui_get_but_vectorf(but, rgb); - - rgb_to_hsv(rgb[0], rgb[1], rgb[2], but->hsv, but->hsv+1, but->hsv+2); - } if((block->flag & UI_BLOCK_LOOP) || ELEM7(but->type, MENU, TEX, LABEL, IDPOIN, BLOCK, BUTM, SEARCH_MENU)) but->flag |= (UI_TEXT_LEFT|UI_ICON_LEFT); |