[cairo] Shouldn't Cairo use/offer degrees rather than radians?
David Kastrup
dak at gnu.org
Thu Jun 29 11:00:43 UTC 2017
David Kastrup <dak at gnu.org> writes:
> I think for cairo_rotate_deg it would be uncontentious since the
> degree representation of the angle does not carry into the internal
> state. I'll likely propose a patch along the lines of the code we use
> in LilyPond.
Of course things are always more complicated than first thought:
cairo_rotate passes its argument through a backend-specific hook. So
the "uncontentious" implementation not impacting the internals would
have to use the hook for generic transforms. That's ugly. At first
glance it would seem that most backends actually only work with ctm's
handled by Cairo anyway.
However, the Cogl backend apparently does something different and Cogl,
apparently explicitly designed for cooperating with Cairo, uses degrees
in its API (cf. CoglEuler).
<https://www.cogl3d.org/cogl-reference/cogl2-Eulers-(Rotations).html>
<https://www.cogl3d.org/cogl-reference/cogl2-Matrices.html#cogl-matrix-rotate>
So it seems tenuous to keep degrees out of the internals.
--
David Kastrup
More information about the cairo
mailing list