Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_handlers.c4
-rw-r--r--source/blender/editors/interface/interface_ops.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 8c3e83894ef..b199e5f66ca 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -776,12 +776,12 @@ static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data,
#ifdef USE_DRAG_TOGGLE
if (ui_is_but_bool(but)) {
/* assumes button has already been pressed */
- const bool is_set = (ui_get_but_val(but) == 0.0);
+ const bool is_set = ui_is_but_push(but);
PointerRNA ptr;
/* auto-key is typically called on mouse-up, but we'r leaving the button so call here */
ui_apply_autokey(C, but);
WM_operator_properties_create(&ptr, "UI_OT_drag_toggle");
- RNA_boolean_set(&ptr, "state", !is_set);
+ RNA_boolean_set(&ptr, "state", is_set);
RNA_int_set(&ptr, "last_x", data->dragstartx);
RNA_int_set(&ptr, "last_y", data->dragstarty);
WM_operator_name_call(C, "UI_OT_drag_toggle", WM_OP_INVOKE_DEFAULT, &ptr);
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 7b40cb9e9eb..f59d970b39a 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -1103,7 +1103,7 @@ static bool ui_but_set_xy_xy(bContext *C, ARegion *ar, const bool is_set, const
/* execute the button */
if (ui_is_but_bool(but) && but->type == but_type_start) {
/* is it pressed? */
- bool is_set_but = (ui_get_but_val(but) != 0.0);
+ bool is_set_but = ui_is_but_push(but);
BLI_assert(ui_is_but_bool(but) == true);
if (is_set_but != is_set) {
uiButExecute(C, but);