diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-10-06 19:22:07 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-10-06 19:54:36 +0300 |
commit | 26df25caefc4ef53909cb15ae247c5bc401f880c (patch) | |
tree | 868281e90cf60d22872cb98ca7564ca5efe954dd /source/blender/editors/interface | |
parent | bd77cdde5865ff311a5af05b1dd0d5a8aa36bb37 (diff) |
UI: remove extraneous inversion of "inverted" button state
Fix an issue where a `UI_BTYPE_CHECKBOX_N` button couldn't be toggled.
When toggling the value of a property, the `UI_BTYPE_TOGGLE_N`,
`UI_BTYPE_ICON_TOGGLE_N`, and `UI_BTYPE_CHECKBOX_N` types shouldn't
matter. These determine the inverted display of the value, but toggles
of that value should still happen once.
For these button types, the toggle happened twice, effectively making it
a no-op. The code for individual values is now also consistent with the
code for handling bit-flags.
Actually found & over-the-shoulder-reviewed by @Severin
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7133c533e11..56e02873b04 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1118,9 +1118,6 @@ static void ui_apply_but_TOG(bContext *C, uiBut *but, uiHandleButtonData *data) } else { value_toggle = (value == 0.0); - if (ELEM(but->type, UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE_N, UI_BTYPE_CHECKBOX_N)) { - value_toggle = !value_toggle; - } } ui_but_value_set(but, (double)value_toggle); |