[gthumb/gthumb-3-4] Set height if aspect ratio is None



commit 7f8439330663d0a4cef6cc1eed0f4092f4620385
Author: Vaclav Brozek <vabr chromium org>
Date:   Sun Jan 1 16:19:11 2017 +0100

    Set height if aspect ratio is None
    
    ratio_combobox_changed_cb handles, in particular, the case when the ratio is
    set to None. If this happens on initialisation of the resize tool UI, both the
    new_height and new_width need to be recomputed from the original height and
    width and the respective scale factors.
    
    However, ratio_combobox_changed_cb only calls
    selection_width_value_changed_cb, which only updates width if the aspect
    ration is not None.
    
    This patch adds a call to selection_height_value_changed_cb inside
    ratio_combobox_changed_cb if the aspect ratio is None, to ensure both
    dimensions are properly updated. An alternative would be to call
    selection_height_value_changed_cb from selection_width_value_changed_cb in the
    None aspect ratio case, but that seems unnecessary for other call-sites of
    selection_width_value_changed_cb (such as resize_width_spinbutton changing its
    value).

 extensions/file_tools/gth-file-tool-resize.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/extensions/file_tools/gth-file-tool-resize.c b/extensions/file_tools/gth-file-tool-resize.c
index a626f07..68568d8 100644
--- a/extensions/file_tools/gth-file-tool-resize.c
+++ b/extensions/file_tools/gth-file-tool-resize.c
@@ -393,6 +393,8 @@ ratio_combobox_changed_cb (GtkComboBox       *combobox,
        self->priv->fixed_aspect_ratio = use_ratio;
        self->priv->aspect_ratio = (double) w / h;
        selection_width_value_changed_cb (GTK_SPIN_BUTTON (GET_WIDGET ("resize_width_spinbutton")), self);
+  if (!use_ratio)
+    selection_height_value_changed_cb (GTK_SPIN_BUTTON (GET_WIDGET ("resize_height_spinbutton")), self);
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]