From fac5e0ee11d33d812aa063a96d6af5148ac52458 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Tue, 29 Nov 2016 13:35:56 -0800 Subject: LinGui: make preview window resize smoother --- gtk/src/preview.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk/src/preview.c b/gtk/src/preview.c index b10aaf09b..eff04e7d3 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -130,8 +130,8 @@ preview_set_render_size(signal_user_data_t *ud, int width, int height) window = GTK_WINDOW(GHB_WIDGET(ud->builder, "preview_window")); gtk_window_unmaximize(window); gtk_window_resize(window, width, height); - geo.min_aspect = (double)width / height; - geo.max_aspect = (double)width / height; + geo.min_aspect = (double)(width - 4) / height; + geo.max_aspect = (double)(width + 4) / height; geo.width_inc = geo.height_inc = 2; gtk_window_set_geometry_hints(window, NULL, &geo, GDK_HINT_ASPECT|GDK_HINT_RESIZE_INC); @@ -901,11 +901,11 @@ GdkPixbuf * do_preview_scaling(signal_user_data_t *ud, GdkPixbuf *pix) } // Allow some slop in aspect ratio so that we fill the window int delta = ud->preview->render_width - width; - if (delta > 0 && delta <= 6) + if (delta > 0 && delta <= 16) width = ud->preview->render_width; delta = ud->preview->render_height - height; - if (delta > 0 && delta <= 6) + if (delta > 0 && delta <= 16) height = ud->preview->render_height; scaled_preview = gdk_pixbuf_scale_simple(pix, width, height, -- cgit v1.2.3