public int getHeight () { return Math.round(super.getHeight() * scaleY); } };
public int getHeight () { return Math.round(super.getHeight() * scaleY); } };
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 getHeight () { if (canvas != null) return Math.max(1, canvas.getHeight()); else return (int)(Display.getHeight() * Display.getPixelScaleFactor()); }
public int getHeight () { if (canvas != null) return Math.max(1, canvas.getHeight()); else return (int)(Display.getHeight() * 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 newHeight = Math.max(canvas.getHeight(), 1); if (width != newWidth || height != newHeight){ width = newWidth;
graphics.fillRect(0, 0, client.getCanvas().getWidth(), client.getCanvas().getHeight());
int height = graphics.canvas.getHeight(); if (lastWidth != width || lastHeight != height) { lastWidth = width;
int height = graphics.canvas.getHeight(); if (lastWidth != width || lastHeight != height) { lastWidth = width;
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())); } });
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())); }
public void componentResized(ComponentEvent e) { if ((canvas_.getWidth() == 0) || (canvas_.getHeight() == 0)) return; IVector2 oldPaddedSize = paddedSize_.copy(); setSize(size_); setPosition(paddedSize_.copy().subtract(oldPaddedSize).multiply(0.5).negate().add(position_)); }