*y= (int)(fy+0.5f);
}
+void ui_window_to_region(const ARegion *ar, int *x, int *y)
+{
+ *x-= ar->winrct.xmin;
+ *y-= ar->winrct.ymin;
+}
+
/* ******************* block calc ************************* */
/* only for pulldowns */
extern void ui_block_to_window_rct(const struct ARegion *ar, uiBlock *block, rctf *graph, rcti *winr);
extern void ui_window_to_block_fl(const struct ARegion *ar, uiBlock *block, float *x, float *y);
extern void ui_window_to_block(const struct ARegion *ar, uiBlock *block, int *x, int *y);
+extern void ui_window_to_region(const ARegion *ar, int *x, int *y);
extern double ui_get_but_val(uiBut *but);
extern void ui_set_but_val(uiBut *but, double value);
if(BLI_in_rcti(&ar->winrct, x, y)) {
/* XXX still can be zero */
if(ar->v2d.mask.xmin!=ar->v2d.mask.xmax) {
- /* mask is in different coord space - take that in account */
- return BLI_in_rcti(&ar->v2d.mask, x-ar->winrct.xmin, y-ar->winrct.ymin);
+ int arx = x;
+ int ary = y;
+ ui_window_to_region(ar, &arx, &ary);
+ return BLI_in_rcti(&ar->v2d.mask, arx, ary);
}
return 1;
}