affine icon indicating copy to clipboard operation
affine copied to clipboard

Add Affine.to_cairo, to output data in column major order suitable for cairo.Matrix(...)

Open stuaxo opened this issue 1 year ago • 2 comments

Trying to use Affine with cairo really confused, me until I found the comment in the cairo code, which made me wonder if there was a difference in the order -

https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/src/cairo-matrix.c#L318

This probably needs a from_cairo, docs, and maybe some tests with round-trips.

The tests should probably be skipped if pycairo is not installed.

stuaxo avatar Feb 22 '24 20:02 stuaxo

@stuaxo I'm glad you are interested in the affine package. However, I'm not willing to add this method. It is just a single line of code that can be easily added to any project that needs it.

sgillies avatar Feb 24 '24 19:02 sgillies

That makes sense.

It may be useful to add to documentation.

The main reason I went for Draft and not an ordinary PR is that I wasn't sure if the change was correct, and that applies if I make a documentation PR.

Does it look like it makes sense, or have I just stumbled on something that works because I made a mistake elsewhere ?

stuaxo avatar Mar 02 '24 12:03 stuaxo