public static void paintSelection( Graphics2D g, int x, int y, int width, int height, Insets insets,
		float arcTopLeft, float arcTopRight, float arcBottomLeft, float arcBottomRight, int flags )
	{
		if( insets != null ) {
			x += insets.left;
			y += insets.top;
			width -= insets.left + insets.right;
			height -= insets.top + insets.bottom;
		}

		if( arcTopLeft > 0 || arcTopRight > 0 || arcBottomLeft > 0 || arcBottomRight > 0 ) {
			double systemScaleFactor = UIScale.getSystemScaleFactor( g );
			if( systemScaleFactor != (int) systemScaleFactor ) {
				// paint at scale 1x to avoid clipping on right and bottom edges at 125%, 150% or 175%
				HiDPIUtils.paintAtScale1x( g, x, y, width, height,
					(g2d, x2, y2, width2, height2, scaleFactor) -> {
						paintRoundedSelectionImpl( g2d, x2, y2, width2, height2,
							(float) (arcTopLeft * scaleFactor), (float) (arcTopRight * scaleFactor),
							(float) (arcBottomLeft * scaleFactor), (float) (arcBottomRight * scaleFactor) );
					} );
			} else
				paintRoundedSelectionImpl( g, x, y, width, height, arcTopLeft, arcTopRight, arcBottomLeft, arcBottomRight );

		} else
			g.fillRect( x, y, width, height );
	}
Paints a selection.
<p>
The bounds of the painted selection (rounded) rectangle are
{@code x + insets.left, y + insets.top, width - insets.left - insets.right, height - insets.top - insets.bottom}.
The given arc radius refers to the painted rectangle (and not to {@code x,y,width,height}).

@since 3
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatUIUtils.java