diff options
author | John Stebbins <[email protected]> | 2016-06-17 11:07:37 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2016-06-17 11:07:37 -0700 |
commit | 7b2284d1bfac621bffef111ae869bb9c8bc191c9 (patch) | |
tree | 4db93783ef4351ef31884435fd38db3fb95c40b8 | |
parent | 221bfe7afa05f8a0a9f85027992328b7c5226de2 (diff) |
LinGui: Fix preview window sizing when there is no title yet
-rw-r--r-- | gtk/src/preview.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/src/preview.c b/gtk/src/preview.c index dab2d3701..c41ebdf65 100644 --- a/gtk/src/preview.c +++ b/gtk/src/preview.c @@ -993,6 +993,10 @@ ghb_set_preview_image(signal_user_data_t *ud) void ghb_rescale_preview_image(signal_user_data_t *ud) { + if (ud->preview->width <= 0 || ud->preview->height <= 0) + { + return; + } double scale = (double)ud->preview->render_width / ud->preview->width; init_preview_image(ud); preview_set_render_size(ud, ud->preview->width * scale, @@ -1012,6 +1016,10 @@ ghb_rescale_preview_image(signal_user_data_t *ud) void ghb_reset_preview_image(signal_user_data_t *ud) { + if (ud->preview->width <= 0 || ud->preview->height <= 0) + { + return; + } init_preview_image(ud); preview_set_render_size(ud, ud->preview->width, ud->preview->height); @@ -1132,6 +1140,10 @@ G_MODULE_EXPORT void preview_reset_clicked_cb(GtkWidget *toggle, signal_user_data_t *ud) { g_debug("preview_reset_clicked_cb()"); + if (ud->preview->width <= 0 || ud->preview->height <= 0) + { + return; + } preview_set_render_size(ud, ud->preview->width, ud->preview->height); // On windows, preview_resize_cb does not get called when the size |