Fix #19713: Lasso select + occlude background geometry does not work.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 17 Dec 2009 15:39:36 +0000 (15:39 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 17 Dec 2009 15:39:36 +0000 (15:39 +0000)
source/blender/editors/space_view3d/view3d_select.c

index a1135bf6986d46baaca7e9c704511df7e114b1a7..e7c8070b7c50fbe7ebc4fbb0f7dcda15d39c0c92 100644 (file)
@@ -461,8 +461,10 @@ static void do_lasso_select_mesh(ViewContext *vc, short mcords[][2], short moves
        data.done = 0;
        data.pass = 0;
 
-       bbsel= EM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
+       /* workaround: init mats first, EM_mask_init_backbuf_border can change
+          view matrix to pixel space, breaking edge select with backbuf .. */
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
+       bbsel= EM_mask_init_backbuf_border(vc, mcords, moves, rect.xmin, rect.ymin, rect.xmax, rect.ymax);
        
        if(ts->selectmode & SCE_SELECT_VERTEX) {
                if (bbsel) {
@@ -1352,8 +1354,8 @@ static void do_mesh_box_select(ViewContext *vc, rcti *rect, int select, int exte
                EM_deselect_all(vc->em);
        }
 
-       bbsel= EM_init_backbuf_border(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
        ED_view3d_init_mats_rv3d(vc->obedit, vc->rv3d); /* for foreach's screen/vert projection */
+       bbsel= EM_init_backbuf_border(vc, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
 
        if(ts->selectmode & SCE_SELECT_VERTEX) {
                if (bbsel) {