Re: Matrix Inconsistency?

Bryce Harrington <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
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”.

Is this the relevant bit of code?

_cairo_gstate_transform (cairo_gstate_t       *gstate,
			 const cairo_matrix_t *matrix)
{
    cairo_matrix_t tmp;
    // ...

    cairo_matrix_multiply (&gstate->ctm, matrix, &gstate->ctm);
    cairo_matrix_multiply (&gstate->ctm_inverse, &gstate->ctm_inverse, &tmp);
    // ...

So there, matrix is indeed being passed first...


Fwiw, I also ran across this fixme in cairo_matrix_multiply:

/*
 * XXX: The ordering of the arguments to this function corresponds
 *      to [row_vector]*A*B. If we want to use column vectors instead,
 *      then we need to switch the two arguments and fix up all
 *      uses.
 */
void
cairo_matrix_multiply (cairo_matrix_t *result, const cairo_matrix_t *a, const cairo_matrix_t *b)

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?


Bryce
-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.