recording-surface: Fix offset error

When a recording surface with non-zero origin is
saved to a png file, it gets cut off. Fix this by
setting a device offset when acquiring the source
image.
This commit is contained in:
Matthias Clasen 2021-01-30 17:57:14 -05:00
parent 76aed3a5e3
commit d07fb41056

View file

@ -609,6 +609,7 @@ _cairo_recording_surface_acquire_source_image (void *abstract_surface,
image = _cairo_image_surface_create_with_content (surface->base.content, image = _cairo_image_surface_create_with_content (surface->base.content,
surface->extents.width, surface->extents.width,
surface->extents.height); surface->extents.height);
cairo_surface_set_device_offset (image, -surface->extents.x, -surface->extents.y);
if (unlikely (image->status)) if (unlikely (image->status))
return image->status; return image->status;