diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-08-26 20:13:19 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-08-26 20:13:19 +0300 |
commit | 583f6948266ba1195c40549d2c8c90f1a1c02e66 (patch) | |
tree | 20f4341c3bbd3d5fe06a7a0c41574b2092a0a773 /source/blender/editors/interface/interface_eyedropper.c | |
parent | aadbdb80484c374f054c23502c76511be588fd77 (diff) |
Fix T90817: Object Picker Doesn't Work on Second window
Solution similar to the one seen in {rBb94ab93dfb82}.
The idea is to find the window and region under the cursor to use in the
operator.
Reviewed By: brecht
Maniphest Tasks: T90817
Differential Revision: https://developer.blender.org/D12310
Diffstat (limited to 'source/blender/editors/interface/interface_eyedropper.c')
-rw-r--r-- | source/blender/editors/interface/interface_eyedropper.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c index 59629e9f1e6..13566a59910 100644 --- a/source/blender/editors/interface/interface_eyedropper.c +++ b/source/blender/editors/interface/interface_eyedropper.c @@ -126,23 +126,15 @@ void eyedropper_draw_cursor_text_window(const struct wmWindow *window, const cha } void eyedropper_draw_cursor_text_region(const struct bContext *C, - const ARegion *region, + const int x, + const int y, const char *name) { - wmWindow *win = CTX_wm_window(C); - const int x = win->eventstate->x; - const int y = win->eventstate->y; - - if ((name[0] == '\0') || (BLI_rcti_isect_pt(®ion->winrct, x, y) == false)) { + if (name[0] == '\0') { return; } - const int mval[2] = { - x - region->winrct.xmin, - y - region->winrct.ymin, - }; - - eyedropper_draw_cursor_text_ex(mval[0], mval[1], name); + eyedropper_draw_cursor_text_ex(x, y, name); } /** |