diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-07-14 21:16:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-07-15 14:40:04 +0300 |
commit | 9ea1b88f0f01a617f452d5eaa44ecbebbaa95c4e (patch) | |
tree | 87dd1c363d2e8ea17178559b6df61bf9d54fbe13 /source/blender/editors/space_view3d/view3d_edit.c | |
parent | b8ffd43bd28ff93c5420d8a50c2cde5a061be118 (diff) |
Cleanup: add utlity function to compute render resolution
Instead of duplicating logic many times.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_edit.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 041663b4a00..d6ddd6d044e 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -413,7 +413,9 @@ static void view3d_set_1_to_1_viewborder(Scene *scene, { RegionView3D *rv3d = region->regiondata; float size[2]; - int im_width = (scene->r.size * scene->r.xsch) / 100; + + int im_width, im_height; + BKE_render_resolution(&scene->r, false, &im_width, &im_height); ED_view3d_calc_camera_border_size(scene, depsgraph, region, v3d, rv3d, size); |