Cleanup: code comment for view3d_viewmatrix_set
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Jan 2018 06:36:51 +0000 (17:36 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Jan 2018 06:36:51 +0000 (17:36 +1100)
source/blender/editors/space_view3d/view3d_view.c

index e7da9e2a074a849ded03dfd9562912b886959ad0..bb8279b9877d69fc1e8b155d42bd205e4a3b8d2a 100644 (file)
@@ -1191,6 +1191,11 @@ void view3d_viewmatrix_set(
                        vec[2] = 0.0f;
 
                        if (rect_scale) {
+                               /* Since 'RegionView3D.winmat' has been calculated and this function doesn't take the 'ARegion'
+                                * we don't know about the region size.
+                                * Use 'rect_scale' when drawing a sub-region to apply 2D offset,
+                                * scaled by the difference between the sub-region and the region size.
+                                */
                                vec[0] /= rect_scale[0];
                                vec[1] /= rect_scale[1];
                        }