Changeset 4860

Show
Ignore:
Timestamp:
08/15/07 21:28:42 (1 year ago)
Author:
morris
Message:

Fix problem with scrollers being enabled where enabling them causes the scaling to shift so that they're no longer needed

Files:

Legend:

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

    r4732 r4860  
    7878        NSSize      contentSize, imageSize, combinedImageSize, frameSize; 
    7979        CGFloat         scrollerWidth; 
     80        double          diff; 
    8081         
    8182        if(_adjustingScaling) 
     
    115116                        scrollerWidth = [NSScroller scrollerWidth]; 
    116117                         
    117                         if(imageSize.width > contentSize.width) { 
     118                        diff = (contentSize.width / imageSize.width) * scrollerWidth; 
     119 
     120                        if(imageSize.width - diff > contentSize.width) { 
    118121                                [_scrollView setHasHorizontalScroller:YES]; 
    119122                                 
     
    121124                                 
    122125                                if(imageSize.height > contentSize.height - scrollerWidth) 
    123                                         frameSize.width -= (contentSize.width / imageSize.width) * scrollerWidth
     126                                        frameSize.width -= diff
    124127                        } 
    125128                         
    126                         if(imageSize.height > contentSize.height) { 
     129                        diff = (contentSize.height / imageSize.height) * scrollerWidth; 
     130 
     131                        if(imageSize.height - diff > contentSize.height) { 
    127132                                [_scrollView setHasVerticalScroller:YES]; 
    128  
     133                                 
    129134                                frameSize.width -= scrollerWidth; 
    130135                                 
    131136                                if(imageSize.width > contentSize.width - scrollerWidth) 
    132                                         frameSize.height -= (contentSize.height / imageSize.height) * scrollerWidth
     137                                        frameSize.height -= diff
    133138                        } 
    134139