Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

Conversation

@franciscojma86
Copy link
Contributor

@franciscojma86 franciscojma86 commented Jan 28, 2019

Avoids generating a UI that is too small in standard resolution monitors. #222

Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the checkin comment, it should say standard resolution, not high resolution. High resolution monitors are exactly the case where we do want non-1 pixel rations.

double dpi = state->window_pixels_per_screen_coordinate *
state->monitor_screen_coordinates_per_inch;
double pixel_ratio = dpi / kDpPerInch;
if (pixel_ratio < 1) pixel_ratio = 1;
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g Jan 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can all become:

double pixel_ratio = std::max(dpi / kDpPerInch, 1.0);

It would be good to add a comment above that line about why this done (i.e., that scaling down on standard resolution monitors gives undesirable results).

@stuartmorgan-g stuartmorgan-g changed the title [Linux] Cap the minimum pixel ratio to 1 [linux/windows] Cap the minimum pixel ratio to 1 Jan 28, 2019
Avoids generating a UI that is too small in high resolution monitors.
@franciscojma86
Copy link
Contributor Author

PTAL!

@franciscojma86 franciscojma86 merged commit ec38f43 into google:master Jan 28, 2019
@franciscojma86 franciscojma86 deleted the pixel branch February 13, 2019 00:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants