[Bf-blender-cvs] [68fe630] master: Fix eyedropper with quad-view

Campbell Barton noreply at git.blender.org
Mon May 4 15:51:24 CEST 2015


Commit: 68fe630735ea6a474e0a303f90cfb72c4e29b973
Author: Campbell Barton
Date:   Mon May 4 23:48:10 2015 +1000
Branches: master
https://developer.blender.org/rB68fe630735ea6a474e0a303f90cfb72c4e29b973

Fix eyedropper with quad-view

===================================================================

M	source/blender/editors/interface/interface_eyedropper.c

===================================================================

diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c
index 80b01b6..44e06ba 100644
--- a/source/blender/editors/interface/interface_eyedropper.c
+++ b/source/blender/editors/interface/interface_eyedropper.c
@@ -176,8 +176,8 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
 
 	if (sa) {
 		if (sa->spacetype == SPACE_IMAGE) {
-			ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
-			if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
+			ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
+			if (ar) {
 				SpaceImage *sima = sa->spacedata.first;
 				int mval[2] = {mx - ar->winrct.xmin,
 				               my - ar->winrct.ymin};
@@ -188,8 +188,8 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
 			}
 		}
 		else if (sa->spacetype == SPACE_NODE) {
-			ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
-			if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
+			ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
+			if (ar) {
 				SpaceNode *snode = sa->spacedata.first;
 				int mval[2] = {mx - ar->winrct.xmin,
 				               my - ar->winrct.ymin};
@@ -200,8 +200,8 @@ static void eyedropper_color_sample_fl(bContext *C, Eyedropper *UNUSED(eye), int
 			}
 		}
 		else if (sa->spacetype == SPACE_CLIP) {
-			ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
-			if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
+			ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
+			if (ar) {
 				SpaceClip *sc = sa->spacedata.first;
 				int mval[2] = {mx - ar->winrct.xmin,
 				               my - ar->winrct.ymin};
@@ -484,8 +484,8 @@ static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int
 
 	if (sa) {
 		if (sa->spacetype == SPACE_VIEW3D) {
-			ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
-			if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
+			ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
+			if (ar) {
 				const int mval[2] = {
 				    mx - ar->winrct.xmin,
 				    my - ar->winrct.ymin};
@@ -767,8 +767,8 @@ static void depthdropper_depth_sample_pt(bContext *C, DepthDropper *ddr, int mx,
 
 	if (sa) {
 		if (sa->spacetype == SPACE_VIEW3D) {
-			ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
-			if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
+			ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
+			if (ar) {
 				View3D *v3d = sa->spacedata.first;
 				RegionView3D *rv3d = ar->regiondata;
 				/* weak, we could pass in some reference point */




More information about the Bf-blender-cvs mailing list