If you have a rectangle with either its width or height less than 0 then it is not painted. It is useful to be able to draw rectangles with a origin in any corner by using negative width and height. It takes a lot of code to protect against this case every where you are using rectangles with dynamic layout so it would be much better if the framework handled this case. Java2D allowed you to paint a rectangle with negative width and/or height.
I good use case for this is drawing a selection rectangle for mouse selection, where you anchor the x,y at drag start and w&h map to dragX, dragY.
I good use case for this is drawing a selection rectangle for mouse selection, where you anchor the x,y at drag start and w&h map to dragX, dragY.