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
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-08-26 20:13:19 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-08-26 20:13:19 +0300
commit583f6948266ba1195c40549d2c8c90f1a1c02e66 (patch)
tree20f4341c3bbd3d5fe06a7a0c41574b2092a0a773 /source/blender/editors/interface/interface_eyedropper_depth.c
parentaadbdb80484c374f054c23502c76511be588fd77 (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_depth.c')
-rw-r--r--source/blender/editors/interface/interface_eyedropper_depth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper_depth.c b/source/blender/editors/interface/interface_eyedropper_depth.c
index a64fad8c333..6f272201085 100644
--- a/source/blender/editors/interface/interface_eyedropper_depth.c
+++ b/source/blender/editors/interface/interface_eyedropper_depth.c
@@ -72,13 +72,14 @@ typedef struct DepthDropper {
ARegionType *art;
void *draw_handle_pixel;
+ int name_pos[2];
char name[200];
} DepthDropper;
static void depthdropper_draw_cb(const struct bContext *C, ARegion *region, void *arg)
{
DepthDropper *ddr = arg;
- eyedropper_draw_cursor_text_region(C, region, ddr->name);
+ eyedropper_draw_cursor_text_region(C, UNPACK2(ddr->name_pos), ddr->name);
}
static int depthdropper_init(bContext *C, wmOperator *op)
@@ -172,6 +173,8 @@ static void depthdropper_depth_sample_pt(
/* weak, we could pass in some reference point */
const float *view_co = v3d->camera ? v3d->camera->obmat[3] : rv3d->viewinv[3];
const int mval[2] = {mx - region->winrct.xmin, my - region->winrct.ymin};
+ copy_v2_v2_int(ddr->name_pos, mval);
+
float co[3];
CTX_wm_area_set(C, area);