OSDN Git Service

MacGui: Fix issue where switching modulus would not properly recalibrate the exisitin...
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 12 Feb 2010 20:11:21 +0000 (20:11 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 12 Feb 2010 20:11:21 +0000 (20:11 +0000)
- Bug found and fix tested by BradleyS.
- Do a dry run of hb_fix_aspect to reset dimensions as per the modulus before running through the rest of the settings.

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

macosx/PictureController.m

index b02dab7..19b3c0a 100644 (file)
     {
         [fModulusLabel setHidden:NO];
         [fModulusPopUp setHidden:NO];
+        if (sender == fModulusPopUp)
+        {
+            /* do a dry run with hb_fix aspect to get new modulus */
+            job->modulus = [[fModulusPopUp titleOfSelectedItem] intValue];
+            job->keep_ratio  = 1;
+            hb_fix_aspect( job, HB_KEEP_WIDTH );
+            if( job->height > fTitle->height )
+            {
+                job->height = fTitle->height;
+                hb_fix_aspect( job, HB_KEEP_HEIGHT );
+            }
+            [fWidthStepper      setIntValue: job->width];
+            [fWidthField        setIntValue: job->width];
+            if( [fAnamorphicPopUp indexOfSelectedItem] != 2) // if we are not loose or custom
+            {
+                [fHeightStepper     setIntValue: job->height];
+                [fHeightField       setIntValue: job->height];
+            }    
+        }
     }
     else
     {