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

Thin stroked shapes are not rendered if affine transform has flip bit

    XMLWordPrintable

Details

    • 2d
    • 9
    • b16

    Backports

      Description

        ICEpdf team reported a rendering issue in Marlin renderer (the bug comes from Pisces code) due to at.getDeterminant() is negative in userSpaceLineWidth() that leads to a NaN stroke width:
        https://github.com/bourgesl/marlin-renderer/issues/36

        "Debugging MarlinRenderingEngine, execution steps into line 208:
        widthScale = (float)Math.sqrt(at.getDeterminant());
        In our scenario, at.getDeterminant() returns the value -0.47389273965262657 and widthScale and thus the value returned by userSpaceLineWidth(AffineTransform, float) is NaN.

        Using the absolute value of at.getDeterminant(), the lines seem to get rendered correctly, the value returned by userSpaceLineWidth(AffineTransform, float) then is 0.18158083"

        After investigation, using the absolute value (before sqrt) is the right solution.

        Attachments

          Issue Links

            Activity

              People

                lbourges Laurent Bourgès
                lbourges Laurent Bourgès
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: