shobhitmehrotra1 / core-plot

Automatically exported from code.google.com/p/core-plot
0 stars 0 forks source link

Momentum scroll + elastic global ranges conflict (OSX) #592

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently momentum scrolling and elastic global ranges get in the way of each 
other. When you start momentum scrolling at the end of the range or it scrolls 
automatically to either end the animation is interrupted as long as the 
momentum scroll animation time and then the elastic backscrolling starts. This 
gives an odd visual appearance.

IMO the separation between momentum scrolling and elastic ranges is artificial. 
Look how that is done with other scrolling controls in the system. Either you 
have both or neither of them. However, this is independent of the timing issue 
mentioned above.

Original issue reported on code.google.com by mike.lischke on 6 Oct 2013 at 2:07

GoogleCodeExporter commented 8 years ago
Actually, by implementing Issue #590 (similar to the provided code there) you 
automatically get momentum scrolling and don't need an own implementation.

Original comment by mike.lischke on 6 Oct 2013 at 2:45

GoogleCodeExporter commented 8 years ago
Issue #590 only applies to the Mac. We need to support native behaviors on iOS, 
too.

Original comment by eskr...@mac.com on 11 Oct 2013 at 12:32

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 6 Nov 2013 at 2:29

GoogleCodeExporter commented 8 years ago
This issue was closed by revision e5c5ca7a61ef.

Original comment by eskr...@mac.com on 7 Nov 2013 at 2:20

GoogleCodeExporter commented 8 years ago
I'm afraid the current implementation is all but usable. First, we need 
separate settings for x and y momentum scrolling. For instance if you want to 
let users scroll in a timeline but not move the graph vertically at all.

Second, the momentum scrolling behaves very crude. When you drag a graph with 
some verve the plotrange moves to huge extends and sometimes scrolls for a long 
time + the time it needs to scroll back to the actual range. The momentum 
should not scroll further than what is possible if you just drag beyond the 
actual plot range. I think it would be better not to do momentum scrolling when 
dragging with the mouse, just do the elastic part. Momentum scrolling can be 
done for mouse wheels and trackpads - for mouse wheels only with high precision 
wheels. I really recommend that you adapt my code on OSX for this scrolling. It 
took me quite some time to get this right and it works now with low precision 
and high precision mice as well as trackpads. Split the implementation for each 
platform if that code cannot be applied to iOS.

Third, it is still not possible to scroll a plotrange using a two finger 
trackpad gesture on OSX. With my code that would automatically be handled too.

Original comment by mike.lischke on 10 Nov 2013 at 12:00

GoogleCodeExporter commented 8 years ago
You're right. If you "fling" the plot space so it scrolls fast, it should slow 
down much faster once it hits the global range so the bounce back happens 
quickly.

Original comment by eskr...@mac.com on 11 Nov 2013 at 3:48

GoogleCodeExporter commented 8 years ago
This issue was closed by revision b92f90ddf9f7.

Original comment by eskr...@mac.com on 7 Dec 2013 at 9:30

GoogleCodeExporter commented 8 years ago
Thanks for those changes. Your are close but no cigar yet :-) Zwo issues still 
exist:

1) I cannot separately switch on/off either dimension. I can only switch 
momentumScrolling on or off for X and Y together. However, to make this really 
usefull I need a way to disable momentum scrolling for the Y axis while it is 
on for the X axis (kinda timeline).

2) There's a small glitch which is a bit difficult to explain, so I made a 
video (attached here). What happens is that when momentum scrolling reaches the 
end of the range it seems shortly display a range far more from the beginning 
and then goes back to the end to finish the scroll-back animation. This is 
really a very short displacement, so I had trouble to take a video from this.

In the video you can see how I drag the x range to the left and the bar values 
show larger values from some lower x range for a moment.

Original comment by mike.lischke on 8 Dec 2013 at 1:48

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by eskr...@mac.com on 8 Dec 2013 at 2:06

GoogleCodeExporter commented 8 years ago
Are you using the default momentum curve and acceleration values?

Original comment by eskr...@mac.com on 9 Dec 2013 at 1:51

GoogleCodeExporter commented 8 years ago
Yes, I only set allowsMomentum to YES. allowsUserInteraction is on as well. 
yRange and globalYRange are the same, which btw. could be used as indicator to 
not use momentumScrolling for that axis (or rather elasticity).

Original comment by mike.lischke on 9 Dec 2013 at 7:43

GoogleCodeExporter commented 8 years ago
Eric, I just found out that I can use plotSpace:willDisplaceBy: to limit 
momentum scrolling to just the x axis, so the only issue remaining is that 
short extra jump.

Original comment by mike.lischke on 9 Dec 2013 at 8:56

GoogleCodeExporter commented 8 years ago
This issue was closed by revision aa520fd7b6a8.

Original comment by eskr...@mac.com on 12 Dec 2013 at 3:09