Skip to content

Commit d7c455d

Browse files
committed
Fix Size Position Rotate filter zoom bug
This occurs if the profile SAR is not 1:1 As reported here: https://forum.shotcut.org/t/size-position-rotate-filter-zoom-bug/46153
1 parent 7bd24ef commit d7c455d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/qml/filters/size_position/SizePositionUI.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Item {
227227
filterRect.x = rectX.value = rightX - filterRect.width;
228228
var middleY = filterRect.y + filterRect.height / 2;
229229
var bottomY = filterRect.y + filterRect.height;
230-
filterRect.height = rectH.value = value / Math.max(aspectRatio, 1e-06);
230+
filterRect.height = rectH.value = value * profile.sar / Math.max(aspectRatio, 1e-06);
231231
if (middleRadioButton.checked)
232232
filterRect.y = rectY.value = middleY - filterRect.height / 2;
233233
else if (bottomRadioButton.checked)
@@ -246,7 +246,7 @@ Item {
246246
filterRect.y = rectY.value = bottomY - filterRect.height;
247247
var centerX = filterRect.x + filterRect.width / 2;
248248
var rightX = filterRect.x + filterRect.width;
249-
filterRect.width = rectW.value = value * aspectRatio;
249+
filterRect.width = rectW.value = value / profile.sar * aspectRatio;
250250
if (centerRadioButton.checked)
251251
filterRect.x = rectX.value = centerX - filterRect.width / 2;
252252
else if (rightRadioButton.checked)
@@ -734,7 +734,7 @@ Item {
734734
filterRect.x = rectX.value = rightX - filterRect.width;
735735
var middleY = filterRect.y + filterRect.height / 2;
736736
var bottomY = filterRect.y + filterRect.height;
737-
filterRect.height = rectH.value = Math.round(filterRect.width / Math.max(aspectRatio, 1e-06));
737+
filterRect.height = rectH.value = Math.round(filterRect.width * profile.sar / Math.max(aspectRatio, 1e-06));
738738
if (middleRadioButton.checked)
739739
filterRect.y = rectY.value = middleY - filterRect.height / 2;
740740
else if (bottomRadioButton.checked)

0 commit comments

Comments
 (0)