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

RenderingHints STROKE_CONTROL should be STROKE_PURE for FX

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • fx1.3
    • None
    • javafx

      When drawing JavaFX graphics there are some cases where you need the Java2D rendering hint STROKE_CONTROL set to STROKE_PURE. This has the effect of turning off pixel fitting for strokes. We should have a attribute on Shape nodes that lets you choose if the stroke should be pixel aligned or not.

      Positives for STROKE_PURE:
         1) Strokes are predictable, you get exactly what a designer would expect at all times, the stroke is exactly where you place it. If it is at 0.5 then you see it there not moved to the nearest pixel.
         2) You eliminate stroke/fill tearing which is caused when the stroke is moved to fit a pixel and the fill is not
         3) Animations where the position of shapes do not fall on pixel boundaries look much smoother(no jumping pixel to pixel). This is very important with slow scrolling ticker style animations.

      Negatives for STROKE_PURE:
         1) A simple stroked shape get Rectangle 100,100,100,100 will not fall on pixel boundaries so can look blurred. This can be fixed by feature RT-3163 if it is set to a default of INSIDE which would then give users a much more predictable result. ie the bounds of a 0,0 100x100 rectangle are 0,0 100x100 irrespective of what stroke is applied. With a default stroke they would currently be -0.5,-0.5 101x101 which is not very obvious.

            flar Jim Graham
            jasper Jasper Potts (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: