Figure out geometry API
2.45 introduced rsvg_handle_get_geometry_sub()
, but it follows the same API pattern of the now-deprecated rsvg_handle_get_dimensions_sub()
.
-
First of all,
get_geometry_sub()
should return a proper GError, not just a gboolean. -
Second, it follows the pattern that passing a NULL element ID will use the whole SVG, but it's quirky in that it may use the SVG's intrinsic
width
andheight
attributes if available, or else it will actually compute the geometry via Cairo path extents.
Maybe we should split this into two APIs?
-
rsvg_handle_get_intrinsic_size()
-> returns an optional width/height, with units. Should we include thepreserveAspectRatio
here? -
rsvg_handle_compute_element_geometry()
-> "compute" here should indicate that this is not an O(1) operation, since it needs to actually walk the tree / make paths / etc.