Manipulator: remove inline matrix calculation
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 Aug 2017 08:13:25 +0000 (18:13 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 Aug 2017 08:13:25 +0000 (18:13 +1000)
source/blender/editors/manipulator_library/manipulator_library_utils.c

index d807ee0791752fdbf6806ebcb1cb8135a12c30d1..fb1d1f89626a46af5fbacd1dbf915e417a8f9de1 100644 (file)
@@ -174,22 +174,13 @@ bool manipulator_window_project_2d(
 {
        float mat[4][4];
        {
-               float matrix_basis_buf[4][4];
-               const void *matrix_basis;
-               if (mpr->type->matrix_basis_get) {
-                       mpr->type->matrix_basis_get(mpr, matrix_basis_buf);
-                       matrix_basis = &matrix_basis_buf[0][0];
-               }
-               else {
-                       matrix_basis = &mpr->matrix_basis[0][0];
-               }
-
-               if (use_offset) {
-                       mul_m4_series(mat, mpr->matrix_space, matrix_basis, mpr->matrix_offset);
-               }
-               else {
-                       mul_m4_series(mat, mpr->matrix_space, matrix_basis);
+               float mat_identity[4][4];
+               struct WM_ManipulatorMatrixParams params = {NULL};
+               if (use_offset == false) {
+                       unit_m4(mat_identity);
+                       params.matrix_offset = mat_identity;
                }
+               WM_manipulator_calc_matrix_final_params(mpr, &params, mat);
        }
 
        /* rotate mouse in relation to the center and relocate it */