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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-23 23:57:36 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-23 23:57:36 +0300
commit411b5f3b100ee385b68c888c278745926357626a (patch)
tree9ea184200790a0676935a06f1dd183cc1da3bb49 /source
parent2ffc3dfc0936f82a50eaf4b0dd0471965963fe6d (diff)
Fix T63822: Sidebar tabs active area dead-zone
Clip on one axis for aligned regions to avoid tabs being clipped out. Introduced in recent fix for T61554
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/screen/area_query.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/editors/screen/area_query.c b/source/blender/editors/screen/area_query.c
index a4bcf622815..4d33567316f 100644
--- a/source/blender/editors/screen/area_query.c
+++ b/source/blender/editors/screen/area_query.c
@@ -112,8 +112,23 @@ bool ED_region_contains_xy(const ARegion *ar, const int event_xy[2])
}
else {
/* Side-bar & any other kind of overlapping region. */
- if (!ED_region_overlap_isect_xy_with_margin(ar, event_xy, overlap_margin)) {
- return false;
+
+ /* Check alignment to avoid region tabs being clipped out
+ * by only clipping a single axis for aligned regions. */
+ if (ELEM(ar->alignment, RGN_ALIGN_TOP, RGN_ALIGN_BOTTOM)) {
+ if (!ED_region_overlap_isect_x_with_margin(ar, event_xy[0], overlap_margin)) {
+ return false;
+ }
+ }
+ else if (ELEM(ar->alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {
+ if (!ED_region_overlap_isect_y_with_margin(ar, event_xy[1], overlap_margin)) {
+ return false;
+ }
+ }
+ else {
+ if (!ED_region_overlap_isect_xy_with_margin(ar, event_xy, overlap_margin)) {
+ return false;
+ }
}
}
}