[cairo] Dealing with unbounded surfaces

Allen, David david.allen at uky.edu
Thu Apr 30 19:08:15 UTC 2020


The Cairo docs use the term "unbounded" which I interpret as meaning that the extents of a figure are not known in advance. Is that interpretation correct? If so, it seems the strategy would be to

1. Call cairo_recording_surface_create with second argument equal "NULL".

2. Draw the figure.

3. Measure the figure using "cairo_recording_surface_ink_extents" or "cairo_recording_surface_get_extents".

4. Shift and scale figure as appropriate for final rendering.

In my attempts to follow this strategy produce nonsensical results for both options in item 3. My test code is attached. Help appreciated!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20200430/97f2c92b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unbounded.cpp
Type: text/x-c++src
Size: 1351 bytes
Desc: unbounded.cpp
URL: <https://lists.cairographics.org/archives/cairo/attachments/20200430/97f2c92b/attachment.cpp>


More information about the cairo mailing list