public int getWidth () { return Math.round(super.getWidth() * scaleX); }
public int getWidth () { return Math.round(super.getWidth() * scaleX); }
private void checkCatched (MouseEvent e) { if (catched && robot != null && canvas.isShowing()) { int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x; int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y; if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) { robot.mouseMove(x, y); } } }
private void checkCatched (MouseEvent e) { if (catched && robot != null && canvas.isShowing()) { int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x; int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y; if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) { robot.mouseMove(x, y); } } }
public int getWidth () { if (canvas != null) return Math.max(1, canvas.getWidth()); else return (int)(Display.getWidth() * Display.getPixelScaleFactor()); }
public int getWidth () { if (canvas != null) return Math.max(1, canvas.getWidth()); else return (int)(Display.getWidth() * Display.getPixelScaleFactor()); }
LwjglGraphics (Canvas canvas) { this.config = new LwjglApplicationConfiguration(); config.width = canvas.getWidth(); config.height = canvas.getHeight(); this.canvas = canvas; }
LwjglGraphics (Canvas canvas) { this.config = new LwjglApplicationConfiguration(); config.width = canvas.getWidth(); config.height = canvas.getHeight(); this.canvas = canvas; }
int newWidth = Math.max(canvas.getWidth(), 1); int newHeight = Math.max(canvas.getHeight(), 1); if (width != newWidth || height != newHeight){
graphics.fillRect(0, 0, client.getCanvas().getWidth(), client.getCanvas().getHeight());
int width = graphics.canvas.getWidth(); int height = graphics.canvas.getHeight(); if (lastWidth != width || lastHeight != height) {
int width = graphics.canvas.getWidth(); int height = graphics.canvas.getHeight(); if (lastWidth != width || lastHeight != height) {
public void componentResized(java.awt.event.ComponentEvent evt) { synchronized (inputQueue) { inputQueue.add(new java.awt.Dimension(c.getWidth(), c.getHeight())); inputQueue.notifyAll(); } } });
private void checkCatched (MouseEvent e) { if (catched && robot != null && canvas.isShowing()) { int x = Math.max(0, Math.min(e.getX(), canvas.getWidth()) - 1) + canvas.getLocationOnScreen().x; int y = Math.max(0, Math.min(e.getY(), canvas.getHeight()) - 1) + canvas.getLocationOnScreen().y; if (e.getX() < 0 || e.getX() >= canvas.getWidth() || e.getY() < 0 || e.getY() >= canvas.getHeight()) { robot.mouseMove(x, y); } } }
public void componentResized(java.awt.event.ComponentEvent evt) { if (myConn != null) myConn.postResizeEvent(new java.awt.Dimension(c.getWidth(), c.getHeight())); } });
public int getWidth () { if (canvas != null) return Math.max(1, canvas.getWidth()); else return (int)(Display.getWidth() * Display.getPixelScaleFactor()); }
LwjglGraphics (Canvas canvas) { this.config = new LwjglApplicationConfiguration(); config.width = canvas.getWidth(); config.height = canvas.getHeight(); this.canvas = canvas; }
/** * Returns the size of the canvas as a vector. * @return size of the canvas in pixel */ public IVector2 getCanvasSize() { return new Vector2Double(canvas_.getWidth(), canvas_.getHeight()); }
@Override public void componentResized(ComponentEvent ce) { impl.resizeCanvas(comp.getWidth(), comp.getHeight()); } });
/** * Returns the size of a pixel. * @retun size of a pixel */ public IVector2 getPixelSize() { Canvas canvas = canvas_; if (canvas == null) return Vector2Double.ZERO; return paddedSize_.copy().divide(new Vector2Double(canvas.getWidth(), canvas.getHeight())); }