Java Rectangle normalizeRect(Rectangle rect)

Here you can find the source of normalizeRect(Rectangle rect)

Description

normalize Rect

License

Open Source License

Declaration

public static void normalizeRect(Rectangle rect) 

Method Source Code

//package com.java2s;
//it under the terms of the GNU Affero General Public License as published by

import java.awt.Rectangle;

public class Main {
    public static void normalizeRect(Rectangle rect) {
        if (rect.width < 0) {
            rect.width = -rect.width;//from   w  w  w .j  ava2s  .  co m
            rect.x -= rect.width;
        }
        if (rect.height < 0) {
            rect.height = -rect.height;
            rect.y -= rect.height;
        }
    }
}

Related

  1. getRectLE(byte[] data, int i)
  2. getSubArea(Shape retangulo, int divisorx, int divisory, int offsetx, int offsety)
  3. inflateRectangle(Rectangle r, int x, int y)
  4. interpolate(Rectangle r1, Rectangle r2, float f)
  5. mergeRects(Set prev, Set current)
  6. randomRectangle(int minW, int maxW, int minH, int maxH)
  7. randomSquare(int minW, int maxW)
  8. rectangleResize(Rectangle rect, int width, int height)
  9. rectCollide(final Rectangle a, final Rectangle b)