[cairo] Adding cairo_shear and family
Behdad Esfahbod
behdad at behdad.org
Sun Jan 11 12:15:02 PST 2009
Hey,
I think the API is mainly designed to be used with either nonzero sx or sy,
not both. I like having the exact matrix in there. We don't do that for
rotate, scale, and translate because they are obvious. I don't like the idea
of separate calls.
behdad
M Joonas Pihlaja wrote:
>
> Hi,
>
> I think calling a 2x2 multiplication by
>
> [ 1 sx]
> [ sy 1]
>
> a shear is slightly misleading since shears don't commute. While it's
> true that shears along the coordinate axes are given respectively by
>
> [1 sx], [1 0],
> [0 1] [sy 1]
>
> it matters whether one does an x-shear first or a y-shear first, and [1
> sx; sy 1] isn't a simple combination of x- and y-shears alone. Also,
> the inverse of the [1 sx; sy 1] matrix is
>
> 1 [1 -sx]
> ----------- [-sy 1].
> (1 - sx sy)
>
> Finally, I think the docs shouldn't give the equations in matrix form
> but rather in words and scalar equations like the others do. None of the
> other cairo_t or cairo_matrix_t functions use matrix form.
>
> Cheers,
>
> Joonas
>
More information about the cairo
mailing list