After calling ply_pixel_buffer_crop_area_to_clip_area cropped_area.x/y
are in device coordinates. So when calculating the x/y offset in the
source-buffer due to device-clip areas possible making cropped_area.x/y
larger then just the xoffset/yoffset (in the canvas) we must multiply
the original xoffset/yoffset by device_scale before subtracting.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
if (cropped_area.width == 0 || cropped_area.height == 0)
return;
- x = cropped_area.x - x_offset;
- y = cropped_area.y - y_offset;
+ x = cropped_area.x - x_offset * canvas->device_scale;
+ y = cropped_area.y - y_offset * canvas->device_scale;
ply_pixel_buffer_copy_area (canvas, source, x, y, &cropped_area);