Changeset 1537

Show
Ignore:
Timestamp:
08/27/04 19:31:49 (4 years ago)
Author:
morris
Message:

check scroller state before appending new text

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCChat.m

    r1532 r1537  
    1 /* $Id: WCChat.m,v 1.64 2004/08/24 18:38:45 morris Exp $ */ 
     1/* $Id: WCChat.m,v 1.65 2004/08/27 17:31:49 morris Exp $ */ 
    22 
    33/* 
     
    681681        NSDate                          *date; 
    682682        double                          interval; 
     683        float                           position; 
    683684        int                                     i, length, offset; 
    684685                 
     
    769770                 
    770771        // --- append 
     772        position = [[_chatOutputScrollView verticalScroller] floatValue]; 
    771773        [_chatOutputTextView appendString:output withURL:YES withChat:YES]; 
    772774 
    773775        // --- scroll 
    774         if([[_chatOutputScrollView verticalScroller] floatValue] == 1.0) { 
     776        if(position == 1.0) { 
    775777                [_chatOutputTextView scrollRangeToVisible: 
    776778                        NSMakeRange([[_chatOutputTextView textStorage] length], 0)]; 
     
    792794        WCUser                          *user; 
    793795        double                          interval; 
     796        float                           position; 
    794797         
    795798        // --- get objects 
     
    864867                 
    865868        // --- append 
     869        position = [[_chatOutputScrollView verticalScroller] floatValue]; 
    866870        [_chatOutputTextView appendString:output withURL:YES withChat:YES]; 
    867871 
    868872        // --- scroll 
    869         if([[_chatOutputScrollView verticalScroller] floatValue] == 1.0) { 
     873        if(position == 1.0) { 
    870874                [_chatOutputTextView scrollRangeToVisible: 
    871875                        NSMakeRange([[_chatOutputTextView textStorage] length], 0)]; 
     
    13371341- (void)printEvent:(NSString *)argument { 
    13381342        NSString        *output, *time; 
     1343        float           position; 
    13391344         
    13401345        // --- build the output string 
     
    13541359         
    13551360        // --- append 
     1361        position = [[_chatOutputScrollView verticalScroller] floatValue]; 
    13561362        [_chatOutputTextView appendString:output withURL:NO withChat:YES]; 
    13571363         
    13581364        // --- scroll 
    1359         if([[_chatOutputScrollView verticalScroller] floatValue] == 1.0) { 
     1365        if(position == 1.0) { 
    13601366                [_chatOutputTextView scrollRangeToVisible: 
    13611367                        NSMakeRange([[_chatOutputTextView textStorage] length], 0)];