Login  Register

Re: HiDPI scaling with Newt

Posted by Jake on Aug 31, 2018; 3:04pm
URL: https://forum.jogamp.org/HiDPI-scaling-with-Newt-tp4039152p4039161.html

Simply doing this override of getClientArea:

canvas = new NewtCanvasSWT(this, SWT.NONE,window) {
       
        @SuppressWarnings("restriction")
                @Override
        public Rectangle getClientArea() {
       
        Rectangle rect = super.getClientArea();
        return DPIUtil.autoScaleUp(rect);
       
        }
        };

Seems to have fixed everything (i have yet to test on mac). Not ideal since it uses the internal API for SWT. I am yet to find any documentation for writing HiDPI widgets for SWT.