@Override public Canvas scale(float x, float y) { ctx.scale(x, y); return this; }
@Override public Canvas scale(float x, float y) { ctx.scale(x, y); return this; }
@Override public Canvas scale(float x, float y) { ctx.scale(x, y); return this; }
public HtmlCanvas(Graphics gfx, HtmlImage image) { super(gfx, image); this.ctx = image.canvas.getContext2d(); float scale = image.scale().factor; ctx.scale(scale, scale); }
public HtmlCanvas(Graphics gfx, HtmlImage image) { super(gfx, image); this.ctx = image.canvas.getContext2d(); float scale = image.scale().factor; ctx.scale(scale, scale); }
protected void applyResize() { CanvasElement element = getElement().cast(); double ratio = getRatio(); element.setWidth((int) (getOffsetWidth() * ratio)); element.setHeight((int) (getOffsetHeight() * ratio)); element.getContext2d().scale(ratio, ratio); getSignaturePad().clear(); }
ctx.scale(ratio, ratio);
@Override public void paint(Canvas canvas, Matrix matrix) { /* * paint image on canvas based on the original and with the transformations of the matrix. * */ Context2d context2d = canvas.getContext2d(); context2d.save(); boolean xReversal = matrix.getXx() < 0; boolean yReversal = matrix.getYy() < 0; context2d.scale(xReversal ? -1 : 1, yReversal ? -1 : 1); double xValue = xReversal ? box.getMaxX() * -1 : box.getX(); double yValue = yReversal ? box.getMaxY() * -1 : box.getY(); context2d.drawImage(hiddenImageCanvas.getCanvasElement(), xValue, yValue, box.getWidth(), box.getHeight()); context2d.restore(); }
ctx.scale(config.scaleFactor, config.scaleFactor); canvas = new AbstractHtmlCanvas(ctx, 0, 0) { @Override public float width() {
backContext.scale(zoom, zoom);
double size = Math.min(getWidth() / viewbox.getWidth(), getHeight() / viewbox.getHeight()); ctx.scale(size, size); ctx.translate(-viewbox.getX(), -viewbox.getY());