private float[] calculateShiftToPositionBBoxOfPointsAt(float left,float top,List<Point> points){
  double minX=Double.MAX_VALUE;
  double maxY=-Double.MAX_VALUE;
  for (  Point point : points) {
    minX=Math.min(point.getX(),minX);
    maxY=Math.max(point.getY(),maxY);
  }
  float dx=(float)(left - minX);
  float dy=(float)(top - maxY);
  return new float[]{dx,dy};
}

private float [ ] calculateShiftToPositionBBoxOfPointsAt ( float left , float top , List < Point > points ) { double minX = Double . MAX_VALUE ; double maxY = - Double . MAX_VALUE ; for ( Point point : points ) { minX = Math . min ( point . getX ( ) , minX ) ; maxY = Math . max ( point . getY ( ) , maxY ) ; } float dx = ( float ) ( left - minX ) ; float dy = ( float ) ( top - maxY ) ; return new float [ ] { dx , dy } ; }
this method calculates the shift needed to be applied to the points in order to position upper and left borders of their bounding box at the given lines .
