Changeset 4900

Show
Ignore:
Timestamp:
09/09/07 18:53:31 (10 months ago)
Author:
morris
Message:

Make scroller fuzz relative to knob proportion to fix a few corner cases

Files:

Legend:

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

    r4732 r4900  
    3737        NSRect          rect; 
    3838        unichar         c; 
    39         float           delta
     39        float           delta, proportion
    4040        BOOL            up, handled = NO; 
    4141         
     
    4747                if([_imageScrollView hasVerticalScroller]) { 
    4848                        scroller = [_imageScrollView verticalScroller]; 
     49                        proportion = [scroller knobProportion] / 30.0; 
    4950                         
    50                         if((up && [scroller floatValue] > 0.01) || (!up && [scroller floatValue] < 0.99)) { 
     51                        if((up &&  [scroller floatValue] > proportion) || 
     52                           (!up && [scroller floatValue] < 1.0 - proportion)) { 
    5153                                rect = [_imageScrollView documentVisibleRect]; 
    5254                                delta = 0.75 * rect.size.height;  
     
    7072                if([_imageScrollView hasVerticalScroller]) { 
    7173                        scroller = [_imageScrollView verticalScroller]; 
     74                        proportion = [scroller knobProportion] / 30.0; 
    7275                         
    73                         if((c == NSPageUpFunctionKey   && [scroller floatValue] > 0.01) || 
    74                            (c == NSPageDownFunctionKey && [scroller floatValue] < 0.99)) { 
     76                        if((c == NSPageUpFunctionKey   && [scroller floatValue] > proportion) || 
     77                           (c == NSPageDownFunctionKey && [scroller floatValue] < 1.0 - proportion)) { 
    7578                                rect = [_imageScrollView documentVisibleRect]; 
    7679                                delta = rect.size.height; 
     
    9497                if([_imageScrollView hasVerticalScroller]) { 
    9598                        scroller = [_imageScrollView verticalScroller]; 
     99                        proportion = [scroller knobProportion] / 30.0; 
    96100                         
    97                         if((c == NSHomeFunctionKey && [scroller floatValue] > 0.01) || 
    98                            (c == NSEndFunctionKey  && [scroller floatValue] < 0.99)) { 
     101                        if((c == NSHomeFunctionKey && [scroller floatValue] > proportion) || 
     102                           (c == NSEndFunctionKey  && [scroller floatValue] < 1.0 - proportion)) { 
    99103                                rect = [_imageView frame]; 
    100104                                rect.origin.y = (c == NSHomeFunctionKey) ? rect.size.height : 0; 
     
    117121                if([_imageScrollView hasVerticalScroller]) { 
    118122                        scroller = [_imageScrollView verticalScroller]; 
     123                        proportion = [scroller knobProportion] / 30.0; 
    119124                         
    120                         if((c == NSUpArrowFunctionKey   && [scroller floatValue] > 0.01) || 
    121                            (c == NSDownArrowFunctionKey && [scroller floatValue] < 0.99)) { 
     125                        if((c == NSUpArrowFunctionKey   && [scroller floatValue] > proportion) || 
     126                           (c == NSDownArrowFunctionKey && [scroller floatValue] < 1.0 - proportion)) { 
    122127                                rect = [_imageScrollView documentVisibleRect]; 
    123128                                delta = 0.75 * rect.size.height;  
     
    141146                if([_imageScrollView hasHorizontalScroller]) { 
    142147                        scroller = [_imageScrollView horizontalScroller]; 
     148                        proportion = [scroller knobProportion] / 30.0; 
    143149                         
    144                         if((c == NSRightArrowFunctionKey && [scroller floatValue] < 0.99) || 
    145                            (c == NSLeftArrowFunctionKey  && [scroller floatValue] > 0.01)) { 
     150                        if((c == NSRightArrowFunctionKey && [scroller floatValue] < proportion) || 
     151                           (c == NSLeftArrowFunctionKey  && [scroller floatValue] > 1.0 - proportion)) { 
    146152                                rect = [_imageScrollView documentVisibleRect]; 
    147153                                delta = 0.75 * rect.size.height;