Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/pixmeo/osirix into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rossetantoine committed Feb 12, 2014
2 parents d34b7fb + 8fce1db commit d49008b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions AYDicomPrint/AYDicomPrintWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ - (ViewerController *) _currentViewer
- (void) _createPrintjob: (id) object
{
NSRect windowFrameToRestore = NSMakeRect(0, 0, 0, 0);
BOOL scaleFitToRestore = m_CurrentViewer.imageView.isScaledFit;

if( [[NSUserDefaults standardUserDefaults] boolForKey: @"SquareWindowForPrinting"])
{
int AlwaysScaleToFit = [[NSUserDefaults standardUserDefaults] integerForKey: @"AlwaysScaleToFit"];
Expand All @@ -398,6 +400,7 @@ - (void) _createPrintjob: (id) object
else newFrame.size.width = newFrame.size.height;

[AppController resizeWindowWithAnimation: m_CurrentViewer.window newSize: newFrame];
if( scaleFitToRestore) [m_CurrentViewer.imageView scaleToFit];

[[NSUserDefaults standardUserDefaults] setInteger: AlwaysScaleToFit forKey: @"AlwaysScaleToFit"];
}
Expand Down Expand Up @@ -535,6 +538,8 @@ - (void) _createPrintjob: (id) object

[AppController resizeWindowWithAnimation: m_CurrentViewer.window newSize: windowFrameToRestore];

if( scaleFitToRestore) [m_CurrentViewer.imageView scaleToFit];

[[NSUserDefaults standardUserDefaults] setInteger: AlwaysScaleToFit forKey: @"AlwaysScaleToFit"];
}

Expand Down
5 changes: 5 additions & 0 deletions ViewerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -17777,6 +17777,8 @@ -(IBAction) endPrint:(id) sender
if( [sender tag]) //User clicks OK Button
{
NSRect windowFrameToRestore = NSMakeRect(0, 0, 0, 0);
BOOL scaleFitToRestore = imageView.isScaledFit;

if( [[NSUserDefaults standardUserDefaults] boolForKey: @"SquareWindowForPrinting"])
{
int AlwaysScaleToFit = [[NSUserDefaults standardUserDefaults] integerForKey: @"AlwaysScaleToFit"];
Expand All @@ -17789,6 +17791,7 @@ -(IBAction) endPrint:(id) sender
else newFrame.size.width = newFrame.size.height;

[AppController resizeWindowWithAnimation: [self window] newSize: newFrame];
if( scaleFitToRestore) [imageView scaleToFit];

[[NSUserDefaults standardUserDefaults] setInteger: AlwaysScaleToFit forKey: @"AlwaysScaleToFit"];
}
Expand Down Expand Up @@ -18072,6 +18075,8 @@ -(IBAction) endPrint:(id) sender

[AppController resizeWindowWithAnimation: [self window] newSize: windowFrameToRestore];

if( scaleFitToRestore) [imageView scaleToFit];

[[NSUserDefaults standardUserDefaults] setInteger: AlwaysScaleToFit forKey: @"AlwaysScaleToFit"];
}
// Start the actuall print operation if there is something to print at all.
Expand Down

0 comments on commit d49008b

Please sign in to comment.