Changeset 4878

Show
Ignore:
Timestamp:
08/22/07 23:13:19 (1 year ago)
Author:
morris
Message:

Update single-image rotation for new system

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Footagehead/trunk/FHImageView.m

    r4876 r4878  
    493493                        } 
    494494                        else if(_imageRotation == 180.0) { 
    495                                 rightRect.origin.x      = rightRect.size.width + floorf((bounds.size.width - size.width) / 2.0); 
     495                                rightRect.origin.x      = rightRect.size.width + floorf((bounds.size.width  - size.width) / 2.0); 
    496496                                rightRect.origin.y      = rightRect.size.height + floorf((bounds.size.height - size.height) / 2.0); 
    497497                                leftRect.origin.x       = rightRect.origin.x + rightRect.size.width; 
     
    516516                        } 
    517517                         
    518                         rect.size = [self _scaledImageSizeForSize:size bounds:bounds.size]; 
    519                         rect.origin.x = floorf((bounds.size.width  - rect.size.width)  / 2.0); 
    520                         rect.origin.y = floorf((bounds.size.height - rect.size.height) / 2.0); 
     518                        rect.size = size = [self _scaledImageSizeForSize:size bounds:bounds.size]; 
     519                         
     520                        if(_imageRotation == 0.0) { 
     521                                rect.origin.x   = floorf((bounds.size.width  - size.width)  / 2.0); 
     522                                rect.origin.y   = floorf((bounds.size.height - size.height) / 2.0); 
     523                        } 
     524                        else if(_imageRotation == 90.0) { 
     525                                rect.origin.x   = floorf((bounds.size.width - size.height) / 2.0); 
     526                                rect.origin.y   = rect.size.width + floorf((bounds.size.height - size.width) / 2.0); 
     527                        } 
     528                        else if(_imageRotation == 180.0) { 
     529                                rect.origin.x   = rect.size.width  + floorf((bounds.size.width  - size.width)  / 2.0); 
     530                                rect.origin.y   = rect.size.height + floorf((bounds.size.height - size.height) / 2.0); 
     531                        } 
     532                        else if(_imageRotation == 270.0) { 
     533                                rect.origin.x   = rect.size.height + floorf((bounds.size.width - size.height) / 2.0); 
     534                                rect.origin.y   = floorf((bounds.size.height - size.width) / 2.0); 
     535                        } 
    521536                         
    522537                        [image drawInRect:rect atAngle:_imageRotation];