From: dynaflash Date: Tue, 18 Nov 2008 17:24:44 +0000 (+0000) Subject: MacGui: Fix issue where proper width was not observed in preview image when using... X-Git-Tag: 0.9.3~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ea0fa911340c4792b6a5daaa35cab9f7341caf1;p=handbrake MacGui: Fix issue where proper width was not observed in preview image when using loose anamorphic. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1926 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm index c32a12036..d63107496 100644 --- a/macosx/PictureController.mm +++ b/macosx/PictureController.mm @@ -182,10 +182,7 @@ are maintained across different sources */ @"Source: %dx%d, Output: %dx%d, Anamorphic: %dx%d", fTitle->width, fTitle->height, output_width, output_height, display_width, output_height]]; - /* FIXME: use the original aspect ratio to calculate the displaySize, - probably the size will not be the right one, - but at least the windows does not resize every time. */ - displaySize.width *= ( ( CGFloat )fTitle->job->pixel_aspect_width) / ( ( CGFloat )fTitle->job->pixel_aspect_height ); + displaySize.width = display_width; } else // No Anamorphic { @@ -197,8 +194,12 @@ are maintained across different sources */ NSSize viewSize = [self optimalViewSizeForImageSize:displaySize]; if( [self viewNeedsToResizeToSize:viewSize] ) { - [self resizeSheetForViewSize:viewSize]; - [self setViewSize:viewSize]; + /* In the case of loose anamorphic, do not resize the window when scaling down */ + if (fTitle->job->pixel_ratio != 2 || [fWidthField intValue] == fTitle->width) + { + [self resizeSheetForViewSize:viewSize]; + [self setViewSize:viewSize]; + } } // Show the scaled text (use the height to check since the width can vary