Re: Getting pattern extents.

Nicola Fontana <[email protected]>
Newsgroups gmane.comp.lib.cairo
Organization eNTiDi
Message-ID <[email protected]>
Il Sun, 14 Dec 2014 13:42:43 +0200 Donn <[email protected]> scrisse:

> Question: How do I get the new extents of pat now? Either via cairo or 
> by basic math? i.e. It's twice as big and has moved. How to get its new 
> top and left, right and bottom?

Hi,

from what I understood you can use cairo_matrix_transform_point() on the
old four points and by applying all the transformations you piled up on
the CTM. In your example that transformations would be:

    cairo_matrix_init_scale(transformations, 2, 2)
    cairo_matrix_translate(transformations, some_x, some_y)

If you do not have access anymore to the transformations you applied,
you can get them knowing the old and the actual CTM:

    # To be tested
    cairo_matrix_invert(old_ctm)
    cairo_matrix_multiply(transformations, ctm, old_ctm)

Ciao.
-- 
Nicola
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.