diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-02-02 18:07:24 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-02-02 18:07:24 +0400 |
commit | 4aaf59324e0ea5fecf28c1e9d54b1aed9b135dc5 (patch) | |
tree | a15460ae3188ccf5b31019ff472507af3f4dbc65 /source/blender/editors/interface/interface_templates.c | |
parent | 8f01ad9bf884f15c9cd6d19971f8ab3a1e1e176c (diff) |
Fix #27213: editing color ramp "Pos:" number value did not update the ramp
properly, when moving the current point before another.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1f6165852d7..4a797b0e960 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1305,6 +1305,16 @@ static void colorband_flip_cb(bContext *C, void *cb_v, void *coba_v) rna_update_cb(C, cb_v, NULL); } +static void colorband_update_cb(bContext *UNUSED(C), void *bt_v, void *coba_v) +{ + uiBut *bt= bt_v; + ColorBand *coba= coba_v; + + /* sneaky update here, we need to sort the colorband points to be in order, + however the RNA pointer then is wrong, so we update it */ + colorband_update_sort(coba); + bt->rnapoin.data = coba->data + coba->cur; +} /* offset aligns from bottom, standard width 300, height 115 */ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand *coba, int xoffs, int yoffs, RNAUpdateCb *cb) @@ -1348,7 +1358,11 @@ static void colorband_buttons_large(uiLayout *layout, uiBlock *block, ColorBand PointerRNA ptr; RNA_pointer_create(cb->ptr.id.data, &RNA_ColorRampElement, cbd, &ptr); row= uiLayoutRow(layout, 0); + uiItemR(row, &ptr, "position", 0, "Pos", ICON_NONE); + bt= block->buttons.last; + uiButSetFunc(bt, colorband_update_cb, bt, coba); + uiItemR(row, &ptr, "color", 0, "", ICON_NONE); } |