[cairo] Adding cairo_shear and family
M Joonas Pihlaja
jpihlaja at cc.helsinki.fi
Sun Jan 11 12:56:43 PST 2009
On Sun, 11 Jan 2009, Behdad Esfahbod wrote:
> I think the API is mainly designed to be used with either nonzero sx or sy,
> not both.
Sure. Still, the docs shouldn't say it's doing an x-shear and a
y-shear at the same time because the operation can't be
represented as any kind of shearing at all (it doesn't preserve
area unless one of sx, sy is zero.)
> I like having the exact matrix in there. We don't do that for
> rotate, scale, and translate because they are obvious.
During a discussion on #cairo a while back I was told that we
don't use matrices in the docs because that would nail down a
specific interpretation for the action of the CTM: Is it from
the left on column vectors vs. from the right on row vectors?
Right now there's no place in the docs that suggests either
interpretation, so even just saying that cairo_shear() multiplies
the CTM by some other matrix is ambiguous.
> I don't like the idea of separate calls.
Me neither, but it's no fun having an operation that does
something else that what it says in the name either. ;)
How about something like
cairo_shear(cr, angle, scale);
This would shear by the given amount along the axis given as an
angle from the x-axis.
Cheers,
Joonas
More information about the cairo
mailing list