Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when using mouse wheel, the scroll.direction was bogus #446

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@onnlucky
Copy link
Collaborator

onnlucky commented Nov 23, 2016

by temporarily setting _lastEvent to draggable, the direction is correctly
calculated when there is no velicity

when using mouse wheel, the scroll.direction was bogus
by temporarily setting _lastEvent to draggable, the direction is correctly
calculated when there is no velicity
@eelco

This comment has been minimized.

Copy link
Collaborator

eelco commented Nov 24, 2016

This behavior is still a bit odd, I think:

scroll = new ScrollComponent
	width: Screen.width
	height: 100
	mouseWheelEnabled: true
	scrollHorizontal: false

layerA = new Layer
	image: Utils.randomImage()
	parent: scroll.content
		
scroll.onScroll ->
	print "scroll", @.direction
	print "draggable", @.draggable.direction

Using a trackpad, if you scroll by moving two fingers up and down (only works when mouseWheelEnabled, the scroll direction will be fine, but the draggable direction is null. When you scroll the content by dragging, the scroll direction is undefined, but the draggable direction is correct.

I think the null value is actually correct, because you’re not dragging the layer, but scrolling it. I would expect the scroll direction to always have a value though.

@onnlucky

This comment has been minimized.

Copy link
Collaborator Author

onnlucky commented Nov 24, 2016

note that before, these were simply always returning "down" ...

when doing this, it is slightly better

scroll.onMove ->
	print "scroll", @.direction
	print "draggable", @.draggable.direction

but I will see about fixing this

@eelco

This comment has been minimized.

Copy link
Collaborator

eelco commented Nov 24, 2016

Yes, sorry for highjacking the pull request :) I think this works well and should be merged and the point I brought up is a ‘new’ issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.