@Override public int getHeight () { return canvas.getHeight(); }
@Override public int getBackBufferHeight () { return canvas.getHeight(); }
@Override public int getHeight () { return canvas.getHeight(); }
@Override public int getBackBufferHeight () { return canvas.getHeight(); }
protected int getRelativeY (Touch touch, CanvasElement target) { float yScaleRatio = target.getHeight() * 1f / target.getClientHeight(); // Correct for canvas CSS scaling return Math.round(yScaleRatio * touch.getRelativeY(target)); }
protected int getRelativeY (Touch touch, CanvasElement target) { float yScaleRatio = target.getHeight() * 1f / target.getClientHeight(); // Correct for canvas CSS scaling return Math.round(yScaleRatio * touch.getRelativeY(target)); }
/** Kindly borrowed from PlayN. **/ protected int getRelativeY (NativeEvent e, CanvasElement target) { float yScaleRatio = target.getHeight() * 1f / target.getClientHeight(); // Correct for canvas CSS scaling return Math.round(yScaleRatio * (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop())); }
/** Kindly borrowed from PlayN. **/ protected int getRelativeY (NativeEvent e, CanvasElement target) { float yScaleRatio = target.getHeight() * 1f / target.getClientHeight(); // Correct for canvas CSS scaling return Math.round(yScaleRatio * (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop())); }
/** * Gets the height of the internal canvas coordinate space. * * @return the height, in pixels * @see #setCoordinateSpaceHeight(int) */ public int getCoordinateSpaceHeight() { return getCanvasElement().getHeight(); }
@Override public int getHeight () { return canvas.getHeight(); }
/** * Gets the height of the internal canvas coordinate space. * * @return the height, in pixels * @see #setCoordinateSpaceHeight(int) */ public int getCoordinateSpaceHeight() { return getCanvasElement().getHeight(); }
/** * Gets the height of the internal canvas coordinate space. * * @return the height, in pixels * @see #setCoordinateSpaceHeight(int) */ public int getCoordinateSpaceHeight() { return getCanvasElement().getHeight(); }
public HtmlImage (Graphics gfx, Scale scale, CanvasElement elem, String source) { super(gfx, scale, elem.getWidth(), elem.getHeight(), source, elem); this.canvas = elem; }
public HtmlImage (Graphics gfx, Scale scale, CanvasElement elem, String source) { super(gfx, scale, elem.getWidth(), elem.getHeight(), source, elem); this.canvas = elem; }
protected int getRelativeY ( final Touch touch, final CanvasElement target ) { final float yScaleRatio = ( target.getHeight() * 1f ) / target.getClientHeight(); // Correct // for // canvas // CSS // scaling return Math.round( yScaleRatio * touch.getRelativeY( target ) ); }
protected int getRelativeY (Touch touch, CanvasElement target) { float yScaleRatio = target.getHeight() * 1f / target.getClientHeight(); // Correct for canvas CSS scaling return Math.round(yScaleRatio * touch.getRelativeY(target)); }
@Override public void setHeight(int height) { this.height = height; if (getCanvas() != null && getCanvas().getHeight() != height) { getCanvas().setHeight(height); } }
/** Kindly borrowed from PlayN. **/ protected int getRelativeY ( final NativeEvent e, final CanvasElement target ) { final float yScaleRatio = ( target.getHeight() * 1f ) / target.getClientHeight(); // Correct // for // canvas // CSS // scaling return Math.round( yScaleRatio * ( ( e.getClientY() - target.getAbsoluteTop() ) + target.getScrollTop() + target.getOwnerDocument().getScrollTop() ) ); }
/** Kindly borrowed from PlayN. **/ protected int getRelativeY (NativeEvent e, CanvasElement target) { float yScaleRatio = target.getHeight() * 1f / target.getClientHeight(); // Correct for canvas CSS scaling return Math.round(yScaleRatio * (e.getClientY() - target.getAbsoluteTop() + target.getScrollTop() + target.getOwnerDocument().getScrollTop())); }
HtmlGLContext(HtmlPlatform platform, float scaleFactor, WebGLRenderingContext gl, CanvasElement canvas) { super(platform, new HtmlGL20(gl), scaleFactor, HtmlUrlParameters.checkGLErrors); this.glc = gl; // try basic GL operations to detect failure cases early tryBasicGLCalls(); setSize(MathUtil.iceil(canvas.getWidth() / scaleFactor), MathUtil.iceil(canvas.getHeight() / scaleFactor)); init(); glc.pixelStorei(UNPACK_PREMULTIPLY_ALPHA_WEBGL, ONE); }