Status: New
Owner: ----

New issue 131 by lionel.victor: PScrollPane does not use setInteracting()  
on the canvas

What steps will reproduce the problem?
1. Use the ScrollingExemple class from teh official samples
2. click/drag the canvas : when moving, PDragSequenceEventHandler changes
the rendering quality as expected
3. click/drag either the vertical or the horizontal scrollbar : the
redering quality is the best by default... does not change when interacting.

What is the expected output?
using scroll bars should set the isInteracting flag on the canvas.

I'm using trunk

I've tried to add the following code in teh PScrollPane construction. It
works but I believe there are far better ways to do this...
Indeed, if one uses setVerticalScrollBar on the PScrollPane patched with
the code below, it would lead to a memory leak as the old scrollbar would
still be linked to the PScrollPane through the notification/callback

I can try to propose other patches if someone guides me to a better idea !

verticalScrollBar.addAdjustmentListener(new AdjustmentListener() {
   private boolean lastAdjustingState =  

   public void adjustmentValueChanged(AdjustmentEvent e) {
     final boolean isAdjusting = verticalScrollBar.getValueIsAdjusting();

     if (isAdjusting != lastAdjustingState) {
       Component c = getViewport().getView();
       if (c instanceof PCanvas) {
         final PCanvas canvas = (PCanvas)c;
         final boolean isInteracting = canvas.getInteracting();
       lastAdjustingState = isAdjusting;

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:

Piccolo2D Developers Group:

Reply via email to