Skip to content

Commit

Permalink
Reduce minimum zoom to 50 percent, for scaled displays
Browse files Browse the repository at this point in the history
like a pinephone
  • Loading branch information
thewierdnut committed Oct 29, 2024
1 parent 78ec280 commit 03e73c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/PreferencesPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using namespace std;
namespace {
// Settings that require special handling.
const string ZOOM_FACTOR = "Main zoom factor";
const int ZOOM_FACTOR_MIN = 100;
const int ZOOM_FACTOR_MIN = 50;
const int ZOOM_FACTOR_MAX = 200;
const int ZOOM_FACTOR_INCREMENT = 10;
const string VIEW_ZOOM_FACTOR = "View zoom factor";
Expand Down
4 changes: 2 additions & 2 deletions source/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int Screen::Zoom()

void Screen::SetZoom(int percent)
{
USER_ZOOM = max(100, min(200, percent));
USER_ZOOM = max(50, min(200, percent));

// Make sure the zoom factor is not set too high for the full UI to fit.
static const int MIN_WIDTH = 1000; // Width of main menu
Expand All @@ -97,7 +97,7 @@ void Screen::SetZoom(int percent)
int minZoomY = 100 * RAW_HEIGHT / MIN_HEIGHT;
int minZoom = min(minZoomX, minZoomY);
// Never go below 100% zoom, no matter how small the window is
minZoom = max(minZoom, 100);
minZoom = max(minZoom, 50);
// Use increments of 10, like the user setting
minZoom -= minZoom % 10;
EFFECTIVE_ZOOM = min(minZoom, UserZoom());
Expand Down

0 comments on commit 03e73c0

Please sign in to comment.