discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Problem ... very slow scrolling.


From: Nicola Pero
Subject: Re: Problem ... very slow scrolling.
Date: Fri, 1 Feb 2002 11:12:01 +0000 (GMT)

> Actually it already does this. When the operation is NSCompositeCopy, it 
> calls the copyBits:fromRect:toPoint: method. The slow scrolling (in this 
> case) is caused in GWorkspace iteself by an unecessary(*) call to 
> setNeedsDisplay:
> 
> GWorkspace/Viewers/IconsViewer/IconsPanel.m:712 
> (gwscrollView:scrollViewScrolled:hitPart:)
> 
> (*) I say unecessarily warily as taking this line out exposes some odd 
> scrolling bug which causes the display to get messed up when scrolling 
> continuously (but gets cleaned up if you just click outside the scroller 
> knob).

The scrolling bug is not actually in scrolling in the gui, but in the
drawing of the icons in GWorkspace (if you notice, the text is always
correct if you scroll, only the icons are drawn wrong).

That is because drawRect: in IconsViewerIcon is using the rect argument
thinking it's the whole area of the icon, while instead it is the exposed
rect.  Normally, the exposed rect is the whole area of the icon, but when
you scroll, icons need often to be only partially redrawn, so drawRect: is
called with an argument which is only part of the icon rect (and it is
precisely the part of the icon needing to be redrawn).  In this case, the
icon gets centered incorrectly.

Said that, I was impressed by seeing GWorkspace in action, there are tons
of new features (it was a while I didn't try it) and I think Enrico is
doing his usual great job.  This scrolling problem is a minor problem in a
part of code which Enrico already said it is very old and dirty, so -
having given my opinion on how to improve it, and having comforted myself
that scrolling in the gui is working correctly, I'll leave the discussion
at this point.




reply via email to

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