[gimp/gimp-2-8] app: only enable the resolution chain button if xres and yres are the same



commit 0defae9024899cfed7a647c467709ef298bd160e
Author: Michael Natterer <mitch gimp org>
Date:   Fri Apr 18 17:57:02 2014 +0200

    app: only enable the resolution chain button if xres and yres are the same
    
    (cherry picked from commit a8592e735276efbe11381538f7dfa8f004a2afbc)

 app/dialogs/print-size-dialog.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/app/dialogs/print-size-dialog.c b/app/dialogs/print-size-dialog.c
index ac31433..0b847e0 100644
--- a/app/dialogs/print-size-dialog.c
+++ b/app/dialogs/print-size-dialog.c
@@ -270,7 +270,8 @@ print_size_dialog_new (GimpImage              *image,
   gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (entry), 1, private->yres);
 
   chain = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
-  gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain), TRUE);
+  if (ABS (private->xres - private->yres) < GIMP_MIN_RESOLUTION)
+    gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain), TRUE);
   gtk_table_attach_defaults (GTK_TABLE (entry), chain, 1, 2, 0, 2);
   gtk_widget_show (chain);
 
@@ -398,13 +399,9 @@ print_size_dialog_set_resolution (PrintSizeDialog *private,
   if (private->chain && gimp_chain_button_get_active (private->chain))
     {
       if (xres != private->xres)
-        {
-          yres = xres;
-        }
+        yres = xres;
       else
-        {
-          xres = yres;
-        }
+        xres = yres;
     }
 
   private->xres = xres;


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