Re: RFC: introduce cairo_surface_get_height() / width()

Uli Schlachter <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Hi,

Am 08.07.2016 um 11:43 schrieb Enrico Weigelt, metux IT consult:
> retrieving surface dimensions currently only works by surface-type
> specific functions, which isn't particularily good encapsulation.
[...]
> So, should we introduce generic functions (and corresponding
> backend ops) for that ?

What's the size of an unbounded surface?

cairo_recording_surface_create(CAIRO_CONTENT_COLOR, NULL); creates a surface
which conceptually has no size limit.

By the way, there is already a "generic hack" that does what you want. Create a
new cairo context and ask for its clip extents:
https://github.com/awesomeWM/awesome/blob/b33fb2a03a2a49b71820e337fc548663203537df/lib/gears/surface.lua#L125-L129

For unbounded surfaces, you get x1=y1=-INFINITY and x2=y2=INFINITY (no idea if
this is guaranteed by the documentation, but at least the current implementation
in _cairo_default_context_clip_extents() does this.

Cheers,
Uli
-- 
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?
-- 
cairo mailing list
[email protected]
https://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.