discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug in NSScrollView


From: Pierre-Yves Rivaille
Subject: bug in NSScrollView
Date: Wed, 1 Nov 2000 11:57:24 +0100 (MET)

Hey,

While using ImageViewer, I came across something that I believe is a bug
(or at least a misfeature, I can't tell my Openstep box is not willing
to boot those days :).

I have made some screenshots so that others can see what I mean :
 http://mapage.cybercable.fr/pyr

The steps to follow to obtain the same results are :
- make the window smaller
- scroll to the upper right corner
- make the window larger

I have made a small workaround fix but I think it should be moved to
somewhere else in the NSScrollView class. Can someone tell me ?


in NSScrollView.m
around line 653 ~
just before the end of "tile:"
add the following


  /* */
  // by PYR
    {
      NSPoint decalage;
      NSRect documentRect = [_contentView documentRect];
      NSRect visibleRect = [_contentView visibleRect];
      BOOL _scrollingError = NO;

      decalage.x = visibleRect.origin.x;
      decalage.y = visibleRect.origin.y;

      if (visibleRect.origin.x + visibleRect.size.width > 
          documentRect.origin.x + documentRect.size.width)
        {
          _scrollingError = YES;
          decalage.x = documentRect.size.width - visibleRect.size.width;
        }

      if (visibleRect.origin.y + visibleRect.size.height >
          documentRect.origin.y + documentRect.size.height)
        {
          _scrollingError = YES;
          decalage.y = documentRect.size.height - visibleRect.size.height;
        }

      if (_scrollingError == YES)
        {
          NSWarnMLog(@"Scrolling error corrected !");
          NSWarnMLog(@"%fx%f+%fx%f inside %fx%f+%fx%f",
                     visibleRect.origin.x,
                     visibleRect.origin.y,
                     visibleRect.size.height,
                     visibleRect.size.width,
                     documentRect.origin.x,
                     documentRect.origin.y,
                     documentRect.size.height,
                     documentRect.size.width);
          [_contentView scrollToPoint: decalage];
        }
  
    }
    /* */

pierre-yves
--------------------
Pierre-Yves Rivaille




reply via email to

[Prev in Thread] Current Thread [Next in Thread]