Skip to content

Commit

Permalink
fix preview 1:1
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroSG94 committed Aug 20, 2024
1 parent 2c4b932 commit 7106c73
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static Pair<Point, Point> getViewport(AspectRatioMode mode, int previewWi
int xf = previewWidth;
int yf = previewHeight;
if ((previewAspectRatio > 1f && streamAspectRatio > previewAspectRatio) ||
(streamAspectRatio < 1f && previewAspectRatio < 1 && streamAspectRatio > previewAspectRatio) ||
(streamAspectRatio <= 1f && previewAspectRatio <= 1 && streamAspectRatio > previewAspectRatio) ||
(streamAspectRatio > 1f && previewAspectRatio < 1f)) {
if (mode == AspectRatioMode.Adjust) {
yf = streamHeight * previewWidth / streamWidth;
Expand All @@ -77,7 +77,7 @@ public static Pair<Point, Point> getViewport(AspectRatioMode mode, int previewWi
xf = streamWidth * previewHeight / streamHeight;
xo = (xf - previewWidth) / -2;
}
} else if ((streamAspectRatio > 1f && previewAspectRatio > 1f && streamAspectRatio < previewAspectRatio) ||
} else if ((streamAspectRatio >= 1f && previewAspectRatio >= 1f && streamAspectRatio < previewAspectRatio) ||
(previewAspectRatio < 1f && streamAspectRatio < previewAspectRatio) ||
(streamAspectRatio < 1f && previewAspectRatio > 1f)) {
if (mode == AspectRatioMode.Adjust) {
Expand Down

0 comments on commit 7106c73

Please sign in to comment.