Fix T88167: Regression: no tooltip for syringe/picker, during picking object

Fix T88167.

Caused by {rB97defd9cd79b6e3ed0e52481a7078107dbe0522b}

`(BLI_rcti_isect_pt` used here to confirm if cursor position is in between active region boundary.
Subtracting min region boundary from the mouse position before the check, fails the condition.

`mval[2]` introduced to hold the region relative mouse position.

Reviewed By: Severin

Maniphest Tasks: T88167

Differential Revision: https://developer.blender.org/D11224
This commit is contained in:
Pratik Borhade 2021-05-19 13:46:55 +02:00 committed by Jeroen Bakker
parent d67223ca29
commit 9e6c4be731
Notes: blender-bot 2023-02-14 11:21:40 +01:00
Referenced by issue #88167, Regression: no tooltip for syringe/picker, during picking object
1 changed files with 8 additions and 3 deletions

View File

@ -130,14 +130,19 @@ void eyedropper_draw_cursor_text_region(const struct bContext *C,
const char *name)
{
wmWindow *win = CTX_wm_window(C);
const int x = win->eventstate->x - region->winrct.xmin;
const int y = win->eventstate->y - region->winrct.ymin;
const int x = win->eventstate->x;
const int y = win->eventstate->y;
if ((name[0] == '\0') || (BLI_rcti_isect_pt(&region->winrct, x, y) == false)) {
return;
}
eyedropper_draw_cursor_text_ex(x, y, name);
const int mval[2] = {
x - region->winrct.xmin,
y - region->winrct.ymin,
};
eyedropper_draw_cursor_text_ex(mval[0], mval[1], name);
}
/**