[cairo-bugs] [Bug 5079] New: Transformation matrix gives wrong results for Postscript backend

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Nov 17 05:31:51 PST 2005


Please do not reply to this email: if you want to comment on the bug, go to    
       
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=5079          
     
           Summary: Transformation matrix gives wrong results for Postscript
                    backend
           Product: cairo
           Version: 1.1.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: postscript backend
        AssignedTo: cworth at cworth.org
        ReportedBy: mike.wimmer at web.de
         QAContact: cairo-bugs at cairographics.org


I've got some problems using the Postscript backend of cairo. 
I guess it's a bug but it could just as well be my limited understanding
of cairo ...

So here's the problem:

The following code snippet should produce a line from the lower left corner
to the upper right corner of the picture:
------------------------------------------------------
  cairo_surface_t *surface=cairo_ps_surface_create("test.ps",200,200);
  cairo_t *cr=cairo_create(surface);

  cairo_matrix_t matrix;

  matrix.xx=1.0;
  matrix.xy=0.0;
  matrix.yx=0.0;
  matrix.yy=-1.0;
  
  matrix.x0=0.0;
  matrix.y0=200;

  cairo_set_matrix(cr,&matrix);

  cairo_move_to(cr,0,0);
  cairo_line_to(cr,200,200);
  cairo_stroke(cr);

  cairo_show_page(cr);
  cairo_destroy(cr);
  cairo_surface_destroy(surface);
----------------------------------------------------
it should actually be equivalent to
---------------------------------------------------
  cairo_move_to(cr,0,200);
  cairo_line_to(cr,200,0);
  cairo_stroke(cr);
----------------------------------------------------

These code snippets do produce the same result for the Xlib
and pdf backends, for the ps backend, the first snippet creates
a diagonal line that is shifted to the left, out of the bounding box,
so that it's only visible in the upper left corner. The second snippet 
gives the correct result. 
This was tested using the latest cairo version from cvs today (11/17/05)
which is 1.1.1, I think.

Kind regards,

Mike Wimmer          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the cairo-bugs mailing list