Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve grid lines visibility on higher resolutions #30117

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EVAST9919
Copy link
Contributor

@EVAST9919 EVAST9919 commented Oct 4, 2024

Closes #30072

Currently grid line thickness remain the same across all resolutions by adjusting it's draw size so that it's screen-space size is always 1px. In this pr I've added a lower limit so with higher resolutions (2k-ish and higher) thickness will be 2px.

Comparison at around 4k:

master pr
master pr

/// <remarks>
/// Unless resolution is high enough, in which case thickness will remain the same.
/// </remarks>
protected float GetLineWidth() => Math.Max(DrawWidth / ScreenSpaceDrawQuad.Width, 0.4f);
Copy link
Member

Choose a reason for hiding this comment

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

On the master screenshot, the lines are all the same size, on the PR, the lines have varying thickness which looks bad (at least when zooming the image to native resolution on 1080p screen).

Maybe having the lines always be an integer pixel size would fix this issue. 1px on 1080p, scaling up to 2px, 3px, etc. when necessary.

First check if 2px size looks good at 4K!

Copy link
Contributor Author

@EVAST9919 EVAST9919 Oct 5, 2024

Choose a reason for hiding this comment

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

Indeed looks better

master (pr + adjustment)
master pr

Though I don't think we need >2px, idk

@peppy peppy self-requested a review October 7, 2024 08:31
@peppy
Copy link
Sponsor Member

peppy commented Oct 7, 2024

This breaks the line display at non-high dpi resolutions:

Before After
Safari 2024-10-07 at 08 37 42 osu! 2024-10-07 at 08 34 56

The whole point is to avoid blurry lines, so that needs to be respected.

Copy link
Sponsor Member

@peppy peppy left a comment

Choose a reason for hiding this comment

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

As proposed

@EVAST9919
Copy link
Contributor Author

Seems like my lower bound isn't low enough. In that case we can increase thickness only for 4k.
I'm not sure if I have any other ideas otherwise..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Increase thickness of grid lines when DPI is high
3 participants