From 3bc40bdb7bf18ad7bdf79fef950430f714bcec39 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Mon, 13 Feb 2023 20:55:49 -0800 Subject: [PATCH] lib: remove scaling code This is a GtkPicture oddity and we shouldn't paper over it here. Instead we can handle it in the display widget. --- lib/mks-cairo-framebuffer.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/mks-cairo-framebuffer.c b/lib/mks-cairo-framebuffer.c index 4c2a056..c286bde 100644 --- a/lib/mks-cairo-framebuffer.c +++ b/lib/mks-cairo-framebuffer.c @@ -114,16 +114,11 @@ mks_cairo_framebuffer_snapshot (GdkPaintable *paintable, { MksCairoFramebuffer *self = MKS_CAIRO_FRAMEBUFFER (paintable); static GdkRGBA black = {0,0,0,1}; - double width_ratio = width / self->width; - double height_ratio = height / self->height; - - if (width_ratio > height_ratio) - width_ratio = height_ratio; - else - height_ratio = width_ratio; gtk_snapshot_save (snapshot); - gtk_snapshot_scale (snapshot, width_ratio, height_ratio); + gtk_snapshot_scale (snapshot, + width / (double)self->width, + height / (double)self->height); gtk_snapshot_append_color (snapshot, &black,