OSDN Git Service

LinGui: fix start chapter range. allowed entry of chapter numbers beyond
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 6 Nov 2008 22:30:11 +0000 (22:30 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Thu, 6 Nov 2008 22:30:11 +0000 (22:30 +0000)
the number of chapters on the disc
Fix a problem with picture scaling. non-anamorphic was allowing dimensions to
be entered that were larger than the title dims.

git-svn-id: svn://localhost/HandBrake/trunk@1899 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/callbacks.c
gtk/src/hb-backend.c

index e332854..515acb5 100644 (file)
@@ -1002,6 +1002,7 @@ show_title_info(signal_user_data_t *ud, ghb_title_info_t *tinfo)
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), tinfo->num_chapters);
        widget = GHB_WIDGET (ud->builder, "start_chapter");
        gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), 1);
+       gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, tinfo->num_chapters);
 }
 
 static gint preview_button_width;
index 6d5bf91..3bc95e3 100644 (file)
@@ -2388,12 +2388,13 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
                        // Height and width are always multiples of 2, so do the rounding
                        new_height = ((new_height + 1) >> 1) << 1;
                        new_width = ((new_width + 1) >> 1) << 1;
-                       g_debug("max w %d, new w %d\n", max_width, new_width);
-                       if (max_width && (new_width > max_width))
+                       if ((max_width && new_width > max_width) || 
+                               new_width > title->width)
                        {
                                height = new_height;
                        }
-                       else if (max_height && (new_height > max_height))
+                       else if ((max_height && new_height > max_height) || 
+                                               new_height > title->height)
                        {
                                width = new_width;
                        }