private static Point center(Rectangle area, Dimension d) {

		// restrict to bounds size
		Rectangle b = area;
		int userWidth = Math.min(b.width, d.width);
		int userHeigh = Math.min(b.height, d.height);

		int halfScreenWidth = b.width / 2;
		int halfUserWidth = userWidth / 2;
		int halfScreenHeight = b.height / 2;
		int halfUserHeight = userHeigh / 2;
		int widthOffset = halfScreenWidth - halfUserWidth;
		int heightOffset = halfScreenHeight - halfUserHeight;
		int x = b.x + widthOffset;
		int y = b.y + heightOffset;
		return new Point(x, y);
	}
Computes the point such that a rectangle with the given size would be centered on the
screen.   The chosen screen in this case is the screen defined by using the given
component.  If the given size is too big to fit on the screen in either dimension,
then it will be placed at the 0 position for that dimension.

@param c the component that should be used to find the current screen
@param d the size of the rectangle to center
@return the upper-left point of the given centered dimension
@see #centerOnScreen(Dimension)
Ghidra/Framework/Generic/src/main/java/generic/util/WindowUtilities.java