Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-07-10 12:31:16 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-07-29 18:18:35 +0300
commit66df8fff328079615dfa222eb7409826a785d6a9 (patch)
tree85ce35da07c2865d6c3bb9f1f9aac20efcda0e5e /source/blender
parentade760337983ff06e5b26230dd744a2eeb60f366 (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/blender')
-rw-r--r--source/blender/compositor/operations/COM_PreviewOperation.cpp4
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;