-
Notifications
You must be signed in to change notification settings - Fork 25
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
Canvas width and height is not reported correctly for OpenGL Viewport #53
Comments
Thanks for reporting. Can reproduce. java.awt.geom.AffineTransform t = canvas.getGraphicsConfiguration().getDefaultTransform();
float sx = (float) t.getScaleX(), sy = (float) t.getScaleY();
int viewportWidth = (int) (getWidth() * sx);
int viewportHeight = (int) (getHeight() * sy); The default transform of the graphics configuration of the canvas will provide the scale factor. |
to handle desktop/graphics configuration scaling.
This bug happens with the latest snapshot, should it still happen? Only on windows, in the same machine but linux works fine. Thanks!! |
Sorry I was still using getWidth instead of getFramebufferWidth, it works perfect, thanks! |
This is not yet deployed to maven, the latest build on maven central is from January 2021. Is it possible to do a deployment with these changes included? edit: |
On Windows when I create an OpenGL Canvas. If Windows Display Scaling is not 100%, if you set glViewport to the canvas's width and height, it will be incorrect.
I set the clear color to red to make it easier to see, this is when the scaling is set to 125% and the viewport is the reported canvas width and height.
The text was updated successfully, but these errors were encountered: