Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8099753

Rectangles with negative width or height do not get painted

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • fx1.1, fx1.2
    • javafx
    • None

      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.

            kcr Kevin Rushforth
            jasper Jasper Potts (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: