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

Fix leftmost title pixel sometimes being cut off #45

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

Friz64
Copy link
Contributor

@Friz64 Friz64 commented Nov 10, 2023

When centering the title text in an window of even width, the leftmost pixel of the title text is being cut off. This is because the clip rect is positioned according to x as a floating point, but the pixmap is positioned according to x as cast to an integer. Casting a float to an int floors it.

For example when x is 100.5, the mask will start at x 100.5, but the pixmap will be drawn at x 100, so a bit of the title text will be cut off.

This is noticeable in the following recording, which shows the window being slowly resized. Focus on the bottom-left of the first "/".

Screencast.from.2023-11-10.20-44-40.webm

Copy link
Owner

@PolyMeilex PolyMeilex left a comment

Choose a reason for hiding this comment

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

Great catch!

@PolyMeilex PolyMeilex merged commit 5fbf875 into PolyMeilex:master Nov 11, 2023
6 checks passed
@PolyMeilex
Copy link
Owner

Thanks!

@Friz64 Friz64 deleted the cut-off-title branch November 11, 2023 16:16
@Friz64 Friz64 mentioned this pull request Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants