[cairo] cairo_clip_extents returns all 0s after a cairo_clip call
psychon at znc.in
Fri Mar 9 05:19:06 PST 2012
On 09.03.2012 13:21, Christian Kellermann wrote:
> I want to check the size of the current clipping region to adjust
> scaling of composed surfaces before masking them in.
> So I am currently doing the following:
> double x1, y1, x2, y2;
> cairo_rectangle( cr, 100, 100, 100, 100);
> cairo_rectangle(cr, 100, 100, 20, 20);
> cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
> This returns all x1,... to be 0.0.
> Now If I call cairo_clip_extents before the call to cairo_clip, I am
> seeing the current screen size, as I would have expected.
> I am probably doing it wrong(tm). What's the right way to do this?
Attached is a small test program which does just what I was expecting. I get the
0 0 200 200
100 100 120 120
First there is no clip set, thus the clip extents are the surface's size. The
second call then prints the result of the clip which was just applied.
What are you doing different?
A learning experience is one of those things that say,
'You know that thing you just did? Don't do that.'
-- Douglas Adams
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: not available
More information about the cairo