Revert "Fix T53850: Lock to Cursor breaks 3D manipulators" blender-v2.79-release
authorCampbell Barton <ideasman42@gmail.com>
Mon, 22 Jan 2018 09:33:43 +0000 (20:33 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 22 Jan 2018 09:33:46 +0000 (20:33 +1100)
This reverts commit f93a6857d8dc15d4be81feafd6dad6ef04d0bd31.

Was intended for 'blender-v2.79a-release' branch.

source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_view.c

index f614f235c66dc4033c59da9bf2397715bacbf411..250e6559b8f268bd60b37e56614ef75e84eb8772 100644 (file)
@@ -2744,17 +2744,10 @@ void ED_view3d_update_viewmat(
                view3d_winmatrix_set(ar, v3d, rect);
 
        /* setup view matrix */
-       if (viewmat) {
+       if (viewmat)
                copy_m4_m4(rv3d->viewmat, viewmat);
-       }
-       else {
-               float rect_scale[2];
-               if (rect) {
-                       rect_scale[0] = (float)BLI_rcti_size_x(rect) / (float)ar->winx;
-                       rect_scale[1] = (float)BLI_rcti_size_y(rect) / (float)ar->winy;
-               }
-               view3d_viewmatrix_set(scene, v3d, rv3d, rect ? rect_scale : NULL);  /* note: calls BKE_object_where_is_calc for camera... */
-       }
+       else
+               view3d_viewmatrix_set(scene, v3d, rv3d);  /* note: calls BKE_object_where_is_calc for camera... */
 
        /* update utility matrices */
        mul_m4_m4m4(rv3d->persmat, rv3d->winmat, rv3d->viewmat);
index b1ccb508e508ccc64044ac9a9132073c0129c9ce..7a106a2783367cd57e566e43c0cd27183bc817cb 100644 (file)
@@ -248,7 +248,7 @@ void ED_view3d_smooth_view_force_finish(
         struct View3D *v3d, struct ARegion *ar);
 
 void view3d_winmatrix_set(ARegion *ar, const View3D *v3d, const rcti *rect);
-void view3d_viewmatrix_set(Scene *scene, const View3D *v3d, RegionView3D *rv3d, const float rect_scale[2]);
+void view3d_viewmatrix_set(Scene *scene, const View3D *v3d, RegionView3D *rv3d);
 
 void fly_modal_keymap(struct wmKeyConfig *keyconf);
 void walk_modal_keymap(struct wmKeyConfig *keyconf);
index 6ebd19aba85772713dd800b013a4386767072f03..5c13fd37dda299e40f0ed1804875bcb5d7b93474 100644 (file)
@@ -1024,18 +1024,8 @@ bool ED_view3d_lock(RegionView3D *rv3d)
        return ED_view3d_quat_from_axis_view(rv3d->view, rv3d->viewquat);
 }
 
-/**
- * Sets #RegionView3D.viewmat
- *
- * \param scene: Scene for camera and cursor location.
- * \param v3d: View 3D space data.
- * \param rv3d: 3D region which stores the final matrices.
- * \param rect_scale: Optional 2D scale argument,
- * Use when displaying a sub-region, eg: when #view3d_winmatrix_set takes a 'rect' argument.
- *
- * \note don't set windows active in here, is used by renderwin too.
- * */
-void view3d_viewmatrix_set(Scene *scene, const View3D *v3d, RegionView3D *rv3d, const float rect_scale[2])
+/* don't set windows active in here, is used by renderwin too */
+void view3d_viewmatrix_set(Scene *scene, const View3D *v3d, RegionView3D *rv3d)
 {
        if (rv3d->persp == RV3D_CAMOB) {      /* obs/camera */
                if (v3d->camera) {
@@ -1094,12 +1084,6 @@ void view3d_viewmatrix_set(Scene *scene, const View3D *v3d, RegionView3D *rv3d,
 
                        mul_v2_v2fl(vec, rv3d->ofs_lock, rv3d->is_persp ? rv3d->dist : 1.0f);
                        vec[2] = 0.0f;
-
-                       if (rect_scale) {
-                               vec[0] /= rect_scale[0];
-                               vec[1] /= rect_scale[1];
-                       }
-
                        mul_mat3_m4_v3(persinv, vec);
                        translate_m4(rv3d->viewmat, vec[0], vec[1], vec[2]);
                }