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

Ugly button images at 125% and 150% scaling on Windows #4901

Closed
JakubValtar opened this Issue Feb 14, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@JakubValtar
Contributor

JakubValtar commented Feb 14, 2017

Toolbar buttons and status bar icons seem to use low res version.

scaling

@JakubValtar JakubValtar added the pde label Feb 14, 2017

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Feb 14, 2017

Member

Hm, it should be pulling the 2x version if zoom is anything above 1x, but it may be doing an ugly job of scaling it down. Quick fix would be more rendering hints set in Toolkit.prepareGraphics() to do nicer image scaling.

Member

benfry commented Feb 14, 2017

Hm, it should be pulling the 2x version if zoom is anything above 1x, but it may be doing an ugly job of scaling it down. Quick fix would be more rendering hints set in Toolkit.prepareGraphics() to do nicer image scaling.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Feb 14, 2017

Contributor

Adding g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); to Toolkit.prepareGraphics() fixed Console and Error icons, but not toolbar buttons (because prepareGraphics() is not called there). After casting the graphics manually in EditorButton.paintComponent() and setting the hint there, buttons are nice too.

Not sending pull request, because I'm not sure if there should also be prepareGraphics call and where to put it.

Contributor

JakubValtar commented Feb 14, 2017

Adding g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); to Toolkit.prepareGraphics() fixed Console and Error icons, but not toolbar buttons (because prepareGraphics() is not called there). After casting the graphics manually in EditorButton.paintComponent() and setting the hint there, buttons are nice too.

Not sending pull request, because I'm not sure if there should also be prepareGraphics call and where to put it.

@benfry benfry changed the title from Ugly buttons at 125% and 150% scaling on Windows to Ugly button images at 125% and 150% scaling on Windows Feb 14, 2017

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Feb 14, 2017

Member

Oh, right—EditorButton is just an image button, it's more Swing-style than the other custom image stuff that makes heavier use of prepareGraphics(). But those sound like the right fixes to me, so please go ahead and check them in or submit a PR if you'd like me to review first.

Member

benfry commented Feb 14, 2017

Oh, right—EditorButton is just an image button, it's more Swing-style than the other custom image stuff that makes heavier use of prepareGraphics(). But those sound like the right fixes to me, so please go ahead and check them in or submit a PR if you'd like me to review first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment