diff options
author | João Araújo <jaraujo98@gmail.com> | 2017-07-26 13:25:24 +0300 |
---|---|---|
committer | João Araújo <jaraujo98@gmail.com> | 2017-07-26 13:25:24 +0300 |
commit | 59908f5eb73670c97c5bb817290a0dac99089900 (patch) | |
tree | 709de097c1fac2ff7b172a8b50dc8a91d7b74860 /source/blender/editors/interface/interface_utils.c | |
parent | 595f2ca2e06e07acaccc473982bde7a5ed644b50 (diff) | |
parent | edc6bec9d60204cb81d2e7533402630b076d0d32 (diff) |
Merge remote-tracking branch 'origin/master' into gsoc2016-improved_extrusiongsoc2016-improved_extrusion
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 636b7e4e9ce..1927d7280f3 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -265,7 +265,7 @@ int UI_icon_from_report_type(int type) */ int UI_calc_float_precision(int prec, double value) { - static const double pow10_neg[UI_PRECISION_FLOAT_MAX + 1] = {1e0, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7}; + static const double pow10_neg[UI_PRECISION_FLOAT_MAX + 1] = {1e0, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6}; static const double max_pow = 10000000.0; /* pow(10, UI_PRECISION_FLOAT_MAX) */ BLI_assert(prec <= UI_PRECISION_FLOAT_MAX); @@ -380,6 +380,17 @@ uiButStore *UI_butstore_create(uiBlock *block) void UI_butstore_free(uiBlock *block, uiButStore *bs_handle) { + /* Workaround for button store being moved into new block, + * which then can't use the previous buttons state ('ui_but_update_from_old_block' fails to find a match), + * keeping the active button in the old block holding a reference to the button-state in the new block: see T49034. + * + * Ideally we would manage moving the 'uiButStore', keeping a correct state. + * All things considered this is the most straightforward fix - Campbell. + */ + if (block != bs_handle->block && bs_handle->block != NULL) { + block = bs_handle->block; + } + BLI_freelistN(&bs_handle->items); BLI_remlink(&block->butstore, bs_handle); |