Skip to content

Commit

Permalink
Fix rounding causing uneven scaling
Browse files Browse the repository at this point in the history
Kdenlive BUG 497435
  • Loading branch information
j-b-m committed Dec 26, 2024
1 parent e70901c commit 8462890
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/modules/qt/filter_qtblend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ static int filter_get_image(mlt_frame frame,
|| rect.h != *height;

if (mlt_properties_get_int(properties, "distort") == 0) {
b_height = qMax(1, qMin((int) rect.h, b_height));
b_width = qMax(1, int(b_height * b_dar / b_ar / consumer_ar));
b_height = qMax(1, qMin(qRound(rect.h), b_height));
b_width = qMax(1, qRound(b_height * b_dar / b_ar / consumer_ar));
} else {
b_width = qMax(1, int(b_width * b_ar / consumer_ar));
b_width = qMax(1, qRound(b_width * b_ar / consumer_ar));
}
if (!hasAlpha && (b_width < *width || b_height < *height)) {
hasAlpha = true;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/qt/transition_qtblend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ static int get_image(mlt_frame a_frame,
transform.translate(rect.x, rect.y);
opacity = rect.o;
if (!distort) {
b_width = qMin((int) rect.w, b_width);
b_height = qMin((int) rect.h, b_height);
b_width = qMin(qRound(rect.w), b_width);
b_height = qMin(qRound(rect.h), b_height);
transform.translate((rect.w - b_width) / 2.0, (rect.h - b_height) / 2.0);
}
if (opacity < 1 || rect.x != 0 || rect.y != 0 || (rect.x + rect.w != *width)
Expand Down

0 comments on commit 8462890

Please sign in to comment.