Uploaded image for project: 'XMLGraphicsCommons'
  1. XMLGraphicsCommons
  2. XGC-41

[PATCH] Incorrect AffineTransform in PSGenerator state due to AbstractPSDocumentGraphics2D.startPage method

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: None
    • Component/s: postscript
    • Labels:
    • Environment:
      Operating System: All
      Platform: All

      Description

      Hi all,

      I extended PSDocumentGraphics2D to generate a more optimized PS code, and I noticed that the PSGenerator always wrote the same transformation matrix again and again.

      After some search, I found that the startPage method in AbstractPSDocumentGraphics2D uses the concatMatrix method of PSGenerator, which alters the PSGenerator current state to save the given AffineTransform.

      I've attached a simple TestCase which shows the problem (fails with current trunk code), and I will attach a simple patch:
      Use gen.writeln(gen.formatMatrix(at) + "concat") instead of gen.concatMatrix(at);

        Attachments

        1. PSDocumentGraphics2DTest.java
          2 kB
          Julien Aymé
        2. AbstractPSDocumentGraphics2D.diff
          1 kB
          Julien Aymé
        3. PSDocumentGraphics2DTest.java
          1 kB
          Julien Aymé

          Activity

            People

            • Assignee:
              general@xmlgraphics.apache.org XML Graphics Project Mailing List
              Reporter:
              julien.ayme@gmail.com Julien Aymé
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: