diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-10 12:31:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-07-29 18:18:35 +0300 |
commit | 66df8fff328079615dfa222eb7409826a785d6a9 (patch) | |
tree | 85ce35da07c2865d6c3bb9f1f9aac20efcda0e5e /source | |
parent | ade760337983ff06e5b26230dd744a2eeb60f366 (diff) |
Compositor: Fix calculation of preview resolution
Were two issues:
- Divider was calculated in integer domain, causing rounding issues in
general case, and causing singularity in a corner case when input is
smaller than the preview size.
- The resolution was scaled down by 1 pixel for no obvious reason.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/compositor/operations/COM_PreviewOperation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cpp b/source/blender/compositor/operations/COM_PreviewOperation.cpp index 30fe2ca824d..07bf534cd74 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cpp +++ b/source/blender/compositor/operations/COM_PreviewOperation.cpp @@ -130,10 +130,10 @@ void PreviewOperation::determineResolution(unsigned int resolution[2], int height = resolution[1]; this->m_divider = 0.0f; if (width > height) { - this->m_divider = COM_PREVIEW_SIZE / (width - 1); + this->m_divider = (float)COM_PREVIEW_SIZE / (width); } else { - this->m_divider = COM_PREVIEW_SIZE / (height - 1); + this->m_divider = (float)COM_PREVIEW_SIZE / (height); } width = width * this->m_divider; height = height * this->m_divider; |