RectangleF { public RectangleF scale(float scale) { this.width = this.width * scale; this.height = this.height * scale; return this; } RectangleF(float x, float y, float width, float height);  RectangleF(); boolean update(float x, float y, float w, float h); RectangleF copy(); Rectangle asIntRect(); RectangleF translateImmutable(RectangleF src, RectangleF dest); RectangleF translate(RectangleF src, RectangleF dest); RectangleF aspectRatioScale(RectangleF dest); RectangleF aspectRatioScaleImmutable(RectangleF dest); RectangleF scale(float scale); RectangleF scaleImmutable(float scale); RectangleF centerImmutable(RectangleF dest); RectangleF center(RectangleF dest); @Override String toString(); DimensionF getDimension(); @Override boolean equals(Object o); @Override int hashCode(); boolean update(RectangleF srcRect); boolean update(Rectangle srcRect); float getAR(); RectangleF position(int x, int y); RectangleF updateHeightUsingAspectRatio(float ar); RectangleF updateWidthUsingAspectRatio(float ar); public float x; public float y; public float width; public float height; }
@Test public void testScale() throws Exception { Rectangle r = new RectangleF(0,0,1920,1080).scale(2).asIntRect(); assertEquals(1920*2, r.width); assertEquals(1080*2, r.height); }