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:
authorCampbell Barton <ideasman42@gmail.com>2015-04-27 11:53:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-27 12:17:07 +0300
commit3f80accfb34dd10e70380139941bcaf62702a6f8 (patch)
treefddd2e77a2b2880c11cbb4ee70bd05d7286d136c /source/blender/blenkernel/intern/screen.c
parent5df939fd15213548346558e76bd2cdc22ebe21a4 (diff)
Fix T44011: Ruler/Knife/Loop-cut fail in quad-view
This is a kind of sloppy-focus, resolving long standing bug with loop-cut/knife/ruler /w quad-view. Where activating a tool would lock onto one of quad-views, especially problematic when activating from the toolbar or menus.
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r--source/blender/blenkernel/intern/screen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 3c43bfa2920..36fd598cc70 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -405,6 +405,23 @@ ARegion *BKE_area_find_region_active_win(ScrArea *sa)
return NULL;
}
+ARegion *BKE_area_find_region_xy(ScrArea *sa, const int regiontype, int x, int y)
+{
+ ARegion *ar_found = NULL;
+ if (sa) {
+ ARegion *ar;
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ if ((regiontype == RGN_TYPE_ANY) || (ar->regiontype == regiontype)) {
+ if (BLI_rcti_isect_pt(&ar->winrct, x, y)) {
+ ar_found = ar;
+ break;
+ }
+ }
+ }
+ }
+ return ar_found;
+}
+
/**
* \note, ideally we can get the area from the context,
* there are a few places however where this isn't practical.