Skip to content

Commit

Permalink
Allow zoom up to -1 zoom factor for using resolution higher than scre…
Browse files Browse the repository at this point in the history
…en max resolution
  • Loading branch information
streetpea committed Apr 8, 2024
1 parent 78bde5c commit 3e6eb65
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions gui/src/qml/StreamView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ Item {
Slider {
id: zoomFactor
orientation: Qt.Vertical
from: 0
from: -1
to: 4
Layout.preferredHeight: 100
stepSize: 0.01
Expand All @@ -283,10 +283,12 @@ Item {
leftMargin: 10
}
text: {
if(parent.value === 0)
if(parent.value === -1)
qsTr("No Black Bars")
else
else if(parent.value >= 0)
qsTr("%1 x").arg(parent.value + 1)
else
qsTr("%1 x").arg(parent.value)
}

}
Expand Down
2 changes: 1 addition & 1 deletion gui/src/qmlmainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ void QmlMainWindow::render()
// Nothing to do, target.crop already covers the full image
break;
case VideoMode::Zoom:
if(zoom_factor == 0)
if(zoom_factor == -1)
pl_rect2df_aspect_copy(&target_frame.crop, &crop, 1.0);
else
{
Expand Down
2 changes: 1 addition & 1 deletion gui/src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void Settings::SetPlaceboPreset(PlaceboPreset preset)

float Settings::GetZoomFactor() const
{
return settings.value("settings/zoom_factor", 0).toFloat();
return settings.value("settings/zoom_factor", -1).toFloat();
}

void Settings::SetZoomFactor(float factor)
Expand Down

0 comments on commit 3e6eb65

Please sign in to comment.