[cairo] Matrix Inconsistency?

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Tue Jul 5 22:36:14 UTC 2016


On Tue, 5 Jul 2016 14:28:38 -0700, Bryce Harrington wrote:

> On Thu, Jun 30, 2016 at 03:57:15PM +1200, Lawrence D'Oliveiro wrote:
>>
>> I wrote:
>>  
>>> ... the docs for cairo_transform
>>> <https://www.cairographics.org/manual/cairo-Transformations.html#cairo-transform>
>>> say “The new transformation of user space takes place after any  
>>>                                                       ^^^^^  
>>> existing transformation”.  
>>
>> I think the fix should be to change “after” to “before”.  
>
> That was introduced in commit
> 0b09748296ea3f0ebb554061ef248373b8437947, which changed the order of
> transformation in the docs for multiply/scale/rotate/translate.  That
> didn't touch the transform docs, perhaps it should have?

Clearly it should have. Presumably the change was introduced to be
consistent with PostScript. E.g. the following works as documented in
the PLRM:

    /mat_rotate
        45 matrix rotate
    def

    /mat_translate
        1 1 matrix translate
    def

    (* matrix:) =
    (rotate × translate = ) print
    mat_rotate mat_translate matrix concatmatrix ==
    (translate × rotate = ) print
    mat_translate mat_rotate matrix concatmatrix ==

    (* graphics state:) =
    matrix setmatrix
    gsave
    (rotate × translate = ) print
    mat_translate concat mat_rotate concat matrix currentmatrix ==
    grestore
    gsave
    (translate × rotate = ) print
    mat_rotate concat mat_translate concat matrix currentmatrix ==
    grestore


More information about the cairo mailing list