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

Align size and position to closest pixel for crisp output #1710

Merged
merged 3 commits into from
Jan 2, 2021

Conversation

andydotxyz
Copy link
Member

This is most noticable on low resolution screens where the new floating-point position could look fuzzy (most notably text, but also lines etc).
Not only does it now look as crisp as when we used integers I think that on a HiDPI this now looks exceptional :)

Checklist:

  • Tests included. <- GL only, just look at any app and see that the text is clear
  • Lint and formatter run with no errors.
  • Tests all pass.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Thank you very much. Applications are now razor sharp again (almost feel better than when we had the integer positions). 👍

I added a comment on a newline that might be unintended, but I ma going approve anyway :)

func rectInnerCoords(size fyne.Size, pos fyne.Position, fill canvas.ImageFill, aspect float32) (fyne.Size, fyne.Position) {
if fill == canvas.ImageFillContain || fill == canvas.ImageFillOriginal {
// change pos and size accordingly

Copy link
Member

Choose a reason for hiding this comment

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

Is this newline intended to be here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just moving the code around to fix ordering, it was a separate commit so you can see it was just that ;)

@andydotxyz andydotxyz merged commit 774c0c3 into fyne-io:develop Jan 2, 2021
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