Re: cairo_path_extents() question

Uli Schlachter <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On 08.10.2012 14:06, Cosmin Apreutesei wrote:
>> I’m not sure if this answers your question, but cairo_path_extents gives a
>> result in user-space coordinates, so it is affected by any change to the
>> current transformation matrix.
> 
> In the above case there's a 45deg-rotated-around-origin space in which
> I draw a 50deg circle around origin. Shouldn't the box be 100x100
> either way? The 141x141 box looks like the result of computing the
> 100x100 box, transforming it by current matrix and then computing the
> bounding box of that box again, resulting in the 141x141 box I see.

Yeah, this is pretty much exactly what happens. Cairo tracks the path extents in
surface coordinates. When asked for some numbers, this rectangle gets
transformed via the inverse of the current user-space transformation. This is
why you get the numbers that you see.

Looking at the documentation for cairo_path_extents, it doesn't say that the
returned extents are "tight". So in theory, returning a rectangle of (INT_MIN,
INT_MIN) x (INT_MAX, INT_MAX) would be allowed. ;-)

Cheers,
Uli
-- 
- Captain, I think I should tell you I've never
  actually landed a starship before.
- That's all right, Lieutenant, neither have I.
-- 
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.