/// Whether an SVG document is being rendered standalone or referenced from an `<image>` element.
/// However, when an SVG document is referenced from an `<image>` element, as in `<image href="foo.svg"/>`,
/// its `preserveAspectRatio` needs to be ignored so that the one from the `<image>` element can
// Preserve the user's transform and use it for the outermost bounding box. All bounds/extents
let mut draw_ctx = DrawingCtx::new(session, cr, &initial_viewport, config, drawsub_stack);
pub fn with_saved_cr<O, F>(cr: &cairo::Context, f: F) -> Result<O, InternalRenderingError>
draw_fn: &mut dyn FnMut(&mut DrawingCtx) -> Result<BoundingBox, InternalRenderingError>,
let (affine, caffine) = if scwscale.approx_eq_cairo(1.0) && schscale.approx_eq_cairo(1.0) {
if clipping && !element_can_be_used_inside_use_inside_clip_path(&child.borrow_element()) {
fn new(current: Transform, initial: Transform, cr_stack_depth: usize) -> CompositingAffines {
ShapeRendering::Auto | ShapeRendering::GeometricPrecision => cairo::Antialias::Default,