Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / space_view3d / view3d_view.c
index c555358f4c30e0441e796a804f33fbe42f89ebc7..3af7f5c8ae8b2723ef15c74abc4a2e8a1d645258 100644 (file)
@@ -1190,6 +1190,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];
                        }