@Override public int height() { return scale.invScaledFloor(rootHeight); }
@Override public int width() { return scale.invScaledFloor(rootWidth); }
/** * Sets the frame buffer to the specified width and height (in pixels). The view will potentially * be smaller than this size if a HiDPI scale factor is in effect. */ public final void setSize(int pixelWidth, int pixelHeight) { viewWidth = scale.invScaledFloor(pixelWidth); viewHeight = scale.invScaledFloor(pixelHeight); curFbufWidth = defaultFbufWidth = pixelWidth; curFbufHeight = defaultFbufHeight = pixelHeight; viewConfigChanged(); }
@Override public int screenWidth() { return ctx.scale.invScaledFloor(Display.getDesktopDisplayMode().getWidth()); }
@Override public int screenWidth() { return ctx.scale.invScaledFloor(Display.getDesktopDisplayMode().getWidth()); }
@Override public int screenHeight() { return ctx.scale.invScaledFloor(Display.getDesktopDisplayMode().getHeight()); }
@Override public int screenHeight() { return ctx.scale.invScaledFloor(Display.getDesktopDisplayMode().getHeight()); }
public void handleEvent(Event event) { // resize our GLCanvas to fill the window; we do manual layout so that other SWT widgets // can be overlaid on top of our GLCanvas Rectangle bounds = comp.getBounds(); comp.setBounds(bounds); canvas.setBounds(bounds); makeCurrent(); // SWTGraphics.this.platform.log().info("Resized " + bounds.width + "x" + bounds.height); ctx.setSize(ctx.scale.invScaledFloor(bounds.width), ctx.scale.invScaledFloor(bounds.height)); } });
public void handleEvent(Event event) { // resize our GLCanvas to fill the window; we do manual layout so that other SWT widgets // can be overlaid on top of our GLCanvas Rectangle bounds = comp.getBounds(); comp.setBounds(bounds); canvas.setBounds(bounds); makeCurrent(); // SWTGraphics.this.platform.log().info("Resized " + bounds.width + "x" + bounds.height); ctx.setSize(ctx.scale.invScaledFloor(bounds.width), ctx.scale.invScaledFloor(bounds.height)); } });