From c3dbd2a46bf8dcfb8aff318dbce4ce5ac1b88d3e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 11 May 2010 14:25:48 +0000 Subject: [PATCH] Dropbox refinement in 3d window: the "drop image" dropbox checks for object under mouse cursor. If not, another dropbox operation can be used. --- .../editors/space_view3d/space_view3d.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 326409f310f..472631c3616 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -413,14 +413,16 @@ static int view3d_mat_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) static int view3d_ima_drop_poll(bContext *C, wmDrag *drag, wmEvent *event) { - if(drag->type==WM_DRAG_ID) { - ID *id= (ID *)drag->poin; - if( GS(id->name)==ID_IM ) - return 1; - } - else if(drag->type==WM_DRAG_PATH){ - if(ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */ - return 1; + if( ED_view3d_give_base_under_cursor(C, event->mval) ) { + if(drag->type==WM_DRAG_ID) { + ID *id= (ID *)drag->poin; + if( GS(id->name)==ID_IM ) + return 1; + } + else if(drag->type==WM_DRAG_PATH){ + if(ELEM(drag->icon, 0, ICON_FILE_IMAGE)) /* rule might not work? */ + return 1; + } } return 0; }