ScrollWrapper and mouse wheel events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ScrollWrapper and mouse wheel events

Holger Kleinsorgen-4
Hello,

another issue with the scroll wrapper :/ But this time I have no idea
how to fix it, so any help is appreciated.

The issue can be found in the following method:

ScrollWrapper>>scrollBy:on:grid:

the comment within the method says

"We assume that the post-scrolling clipping bounds can be
smaller than the pre-scrolling clipping bounds only at the
edge being scrolled in.  That is, if we're scrolling forwards,
only the end of the component's translated bounds can be
truncated.  If we're scrolling backwards, only the beginning
of the translated bounds can be truncated."

However, this is not true for mouse wheel events. Scrolling with the
mouse wheel can cause garbled views when highlighting views are involved.
The new prerequisites view can be tweaked to illustrate the problem.

It only scrolls by 1 pixel, so let's change that first:

PrerequisitesExplorer>>scrollBy: aYDelta
   | y |
   " scroll by 16 pixels for each event "
   y := scrollOffsetHolder value y - (aYDelta * 16).
   y := (y min: 0)
      max: self bounds height - self preferredHeight rounded - 30.
        scrollOffsetHolder value: 0 @ y

Now
- expand the prerequisites of "Base VisualWorks"
- scroll down
- position the cursor over a view with a highlighting event handle
- scroll up, using the mouse wheel
- note that the view is slightly damaged
- scroll even more, using the mouse wheel. Even more damage appears. It
will go away when the entire view is redisplayed
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: ScrollWrapper and mouse wheel events

Holger Kleinsorgen-4
Am 02.04.2010 19:39, schrieb Holger Kleinsorgen:

> Hello,
>
> another issue with the scroll wrapper :/ But this time I have no idea
> how to fix it, so any help is appreciated.
>
> The issue can be found in the following method:
>
> ScrollWrapper>>scrollBy:on:grid:
>
> the comment within the method says
>
> "We assume that the post-scrolling clipping bounds can be
> smaller than the pre-scrolling clipping bounds only at the
> edge being scrolled in.  That is, if we're scrolling forwards,
> only the end of the component's translated bounds can be
> truncated.  If we're scrolling backwards, only the beginning
> of the translated bounds can be truncated."
>
> However, this is not true for mouse wheel events. Scrolling with the
> mouse wheel can cause garbled views when highlighting views are involved.
> The new prerequisites view can be tweaked to illustrate the problem.

It seems to be another case of "don't draw directly on the graphics
context of the medium". Obviously, this would mean "some" work to get it
done right. It's even worse when using a double buffering policy.

For the time being I added a rather ugly patch to the ScrollWrapper
(which I don't want to share due to its uglyness ;)
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc