Re: Getting pattern extents.
Nicola Fontana <[email protected]>
| Newsgroups | gmane.comp.lib.cairo |
|---|---|
| Organization | eNTiDi |
| Message-ID | <[email protected]> |
Il Tue, 16 Dec 2014 14:51:46 +0200 Donn <[email protected]> scrisse: > Nicola, > I have produced some code (in vala) using your suggestion. The attached > image shows what's happening. I admit it has been difficult to understand the code... too many nested save/restore pairs for my limited memory. Anyway I found 2 errors. The first one: > [...] > ctm.multiply(ctm,otm); //ctm is now changed. ctm = ctm * otm should be ctm.multiply(otm,ctm) (sorry, my bad). Then just before using ce1 and ce2 you should apply the identity matrix (as you already did for the original bounding box): > [...] > //Try drawing something with these numbers: cr.identity_matrix(); > cr.set_source_rgb(1,0,1); > cr.rectangle( cex1, cey1, cex2-cex1, cey2-cey1); > cr.stroke(); > [...] After that the two red dots will be rendered in the correct position. To get the whole bounding box you should apply the same transformation to the other two corners. Ciao. -- Nicola -- cairo mailing list [email protected] http://lists.cairographics.org/mailman/listinfo/cairo