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-11-09 17:27:25 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-11-09 17:27:25 +0300
commit9dc3f454d9744ffc1c74d7566718b7b032af6cf9 (patch)
tree22a0abf49c8a68e7b87666b3b27b1430578cede3 /source/blender/editors
parentc092cc35b30fa121ff579f00bbaf8e2dc981a3f2 (diff)
parent9b2f2120163286bf08fa5ed341fa01eea8283dca (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/view3d_cursor_snap.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/view3d_cursor_snap.c b/source/blender/editors/space_view3d/view3d_cursor_snap.c
index fbdab71ec1d..bb387adb82e 100644
--- a/source/blender/editors/space_view3d/view3d_cursor_snap.c
+++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c
@@ -692,7 +692,7 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state,
const int orient_index = BKE_scene_orientation_get_index(scene, SCE_ORIENT_DEFAULT);
const int pivot_point = scene->toolsettings->transform_pivot_point;
ED_transform_calc_orientation_from_type_ex(
- scene, view_layer, v3d, region->regiondata, ob, ob, orient_index, pivot_point, omat);
+ scene, view_layer, v3d, rv3d, ob, NULL, orient_index, pivot_point, omat);
if (state->use_plane_axis_auto) {
mat3_align_axis_to_v3(omat, state->plane_axis, rv3d->viewinv[2]);
@@ -770,7 +770,22 @@ static bool v3d_cursor_snap_pool_fn(bContext *C)
return false;
}
- ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
+ ARegion *region = CTX_wm_region(C);
+ if (region->regiontype != RGN_TYPE_WINDOW) {
+ if (!region->overlap) {
+ return false;
+ }
+ /* Sometimes the cursor may be on an invisible part of an overlapping region. */
+ const wmWindowManager *wm = CTX_wm_manager(C);
+ const wmEvent *event = wm->winactive->eventstate;
+ if (ED_region_overlap_isect_xy(region, event->xy)) {
+ return false;
+ }
+ /* Find the visible region under the cursor.
+ * TODO(Germano): Shouldn't this be the region in context? */
+ region = BKE_area_find_region_type(area, RGN_TYPE_WINDOW);
+ }
+
RegionView3D *rv3d = region->regiondata;
if (rv3d->rflag & RV3D_NAVIGATING) {
/* Don't draw the cursor while navigating. It can be distracting. */