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

Rendering JavaFX shapes generated from Number (Float) calculations seems to truncate the Float values rather than rounding them to integers at pixel locations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • fx1.3
    • fx1.1.1
    • javafx
    • Windows Vista x64, JDK 1.6.13, using Netbeans 6.5.1 bundle with JavaFX 1.1.1.

      I am creating some shapes using PathElements calculated from rotations. Sometimes these calculations end up on "very close" approximations to the integer value - for example, a result might be 89.9997 or so. When rendered, I see aliasing effects where I don't expect to see them, normally. I would expect the rounding to give me a final pixel location of 90 instead of 89.

      Attached is a sample Scene and screencap showing this result. I'm not 100% sure this is a bug or just what you get with non-integral pixel dimensions. I am getting around it by selectively rounding Number/Float values sufficiently close to integral values using java.lang.Math.round().

            tdv Dmitri Trembovetski (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: