printing: Add printing support

Part-of: <https://gitlab.gnome.org/Incubator/loupe/-/merge_requests/165>
This commit is contained in:
Sophie Herold 2023-04-02 01:39:23 +02:00 • committed by Marge Bot
parent e96b9ccac9
commit ae5ca76176
22 changed files with 936 additions and 49 deletions

View file

@ -86,6 +86,11 @@ impl Tile {
let area = round(&self.area().scale(zoom, zoom));
let area_with_bleed = round(&self.area_with_bleed().scale(zoom, zoom));
if area_with_bleed.width() < 1. || area_with_bleed.height() < 1. {
log::warn!("Trying to draw image with dimensions smaller than 1");
return;
}
// TODO: do not clip outer bounderies of the image
snapshot.push_clip(&area);
if let Some(background_color) = &options.background_color {