Re: Getting pattern extents.
Nicola Fontana <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Organization | eNTiDi |
| Message-ID | <[email protected]> |
Il Tue, 16 Dec 2014 20:51:31 +0200 Donn <[email protected]> scrisse: > On 16/12/2014 19:30, Nicola Fontana wrote: > > I wish my theoretical background included this matrix stuff. High school > stopped at Calculus ... and that was over twenty years ago! :D Me and > math just don't get along. Same here ;) The only thing you need to know is that matrix.transform_point(ref x, ref y); matrix.invert(); matrix.transform_point(ref x, ref y); is effectively a no-op, that is applying an inverted matrix to a point "strips" the effects of that matrix from the point. In your case I strip the original matrix (otm) and appy the new matrix (ctm) to be able to use the point in the identity space, that is: otm.invert(); otm.transform_point(ref x, ref y); ctm.transform_point(ref x, ref y); and the above code is exactly equivalent [1] to the provided one. Ciao. -- Nicola [1] http://cairographics.org/manual/cairo-cairo-matrix-t.html#cairo-matrix-multiply -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo