-
Notifications
You must be signed in to change notification settings - Fork 16
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
Strange Segment-behavior with two tracks #35
Comments
Here's my code for reference:
|
Hi, I have add this issue before but can't remember the cause, looks like your delta x is twice larger as it should be. Do you have a public repo for your project so I could run it ? |
@b-ma Here you go https://bl.ocks.org/justinlevi/9eed1adbb79f30b78eeb464eb3fb04a2 Here's the gist as well. Updated my code example above to reflect this example as well. |
@b-ma Here's an interesting discovery. If I add both layers to the same track, the drag functionality works as expected. Working example here. Not sure what this points to other than the fact that multiple tracks seem to be causing the bug |
Here is one more cleaned up example creating the tracks and layers manually instead of using the https://bl.ocks.org/justinlevi/9340df9dbec02a70ba3655b6862d51f2 Could it be that the drag event is firing twice for some reason? |
Hey, that's it, the fact is that you create 2 tracks on the same DOM element, then the timeline instanciate 1 surface for each track and thus each event is triggered twice.
(actually, looking at your code, I would go for solution 1, as its just a matter of removing one of the tracks) This should fix the problem. |
Side question, which tool do you use for creating these animated gifs? |
BINGO! That did the trick. https://bl.ocks.org/justinlevi/d2baaf13f2445d29b2d7cd047fca1c29 I ended up going with two DOM elements as that feels like it is closer to the actual DAW metaphor in this case. Having two layers in the same track doesn't feel as clean. I wonder if this is something the library might be able to do automatically though? In my mind, I was dedicating a single DOM element to creating a wavejs interface, probably because I'm thinking more from a React perspective. Either way though, could there be some logic applied here that would create a new DOM element if you try to create two tracks on the root DOM? I haven't thought this all through obviously... I use Screenflow for all of my animated gifs. It's incredibly useful. |
Unfortunately, I'm noticing some strange issues with the SegmentBehavior code when I have two tracks. Please see the attached animated gif for details.
Problem:
The dragged segment does not stay under the mouse.
What I expect:
the dragged segment to stay under the mouse.
Is this because the time context being used is related to the wrong track?
Although I am using a custom behavior, I can duplicate the issue using the default
segment-behavior.js
The text was updated successfully, but these errors were encountered: