diff options
author | John Stebbins <[email protected]> | 2016-11-29 13:35:56 -0800 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-11-29 13:36:43 -0800 |
commit | fac5e0ee11d33d812aa063a96d6af5148ac52458 (patch) | |
tree | 34a2562f6afa7c4d6bbd36440bf49835f057700e | |
parent | 41defa9c9c8a3e7dfad8424b2afb167aab629cb6 (diff) |
LinGui: make preview window resize smoother
-rw-r--r-- | gtk/src/preview.c | 8 |
1 files 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, |