scaleInstanceScaleXY static method

AffineTransformation scaleInstanceScaleXY(
  1. double xScale,
  2. double yScale,
  3. double x,
  4. double y,
)

Creates a transformation for a scaling relative to the point (x,y).

@param xScale the value to scale by in the x direction @param yScale the value to scale by in the y direction @param x the x-ordinate of the point to scale around @param y the y-ordinate of the point to scale around @return a transformation for the scaling

Implementation

static AffineTransformation scaleInstanceScaleXY(
    double xScale, double yScale, double x, double y) {
  AffineTransformation trans = new AffineTransformation();
  trans.translate(-x, -y);
  trans.scale(xScale, yScale);
  trans.translate(x, y);
  return trans;
}