private static void fixRectangleOrientation(double[] m,Rectangle2D clip){
  if (clip.getWidth() > 0 != (m[2] - m[0] > 0)) {
    double t=m[0];
    m[0]=m[2];
    m[2]=t;
  }
  if (clip.getHeight() > 0 != (m[3] - m[1] > 0)) {
    double t=m[1];
    m[1]=m[3];
    m[3]=t;
  }
}

private static void fixRectangleOrientation ( double [ ] m , Rectangle2D clip ) { if ( clip . getWidth ( ) > 0 != ( m [ 2 ] - m [ 0 ] > 0 ) ) { double t = m [ 0 ] ; m [ 0 ] = m [ 2 ] ; m [ 2 ] = t ; } if ( clip . getHeight ( ) > 0 != ( m [ 3 ] - m [ 1 ] > 0 ) ) { double t = m [ 1 ] ; m [ 1 ] = m [ 3 ] ; m [ 3 ] = t ; } }
sets orientation of the rectangle according to the clip .
