-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Timeline autoPan implemented #897
Conversation
} | ||
|
||
if (this._autoPan !== 0) { | ||
if ((xPos > 3 * width / 8) && (xPos < 5 * width / 8 )) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, it turns out this is "shaky" because xPos
here is calculated based on _scrubJulian
after it was already advanced by the clock. What you need is the xPos from the previous frame, which happens to be available as this._lastXPos
already. This tells you where the scrubber was before time advanced, so you know if it used to be in the double-speed zone or not. You only need _lastXPos here on line 514, not on the lines above.
This is a cool feature. I found another small bug: Load |
I think something went wrong. |
Everything looks okay to me, what do you think is wrong? |
It's a rebased merge from main, so there are copies of changelists from other folks. Fixing it is tricky, but goes something like this. First, make a backup of the one file you changed. Then:
Stop and make sure "master" is up to date with the latest upstream copy of master, then continue:
Stop again and make sure the newly created TimelineScrubber branch has all your changes from the old branch. When you're satisfied it does, force-push it to GitHub, to overwrite the old branch.
This pull request should update after you do this, and the extra commits should disappear. I'm not sure what exactly causes this problem, but I'm pretty sure it has something to do with our advice for everyone to turn on automatic rebase for all git pulls. |
Actually, the extra commits don't look like they were rebased. The SHA1s match the commits in Cesium master. I'm not sure why GitHub is showing them as part of the pull request when |
Thanks @emackey , Also regarding the bug related to |
No, just check if the current time is on the opposite side of the screen from the autopan direction. |
@macoda is this ready for another review? Whenever someone requests changes during a review, it's good practice to post a message after you have made them, this way we know to look at it again. |
@macoda yes GitHub doesn't send automatic notifications of each commit, because sometimes it takes multiple commits to get to a state where you want more feedback. So, writing a comment asking for additional review is the recommended way to go. I like this branch, but the performance is hurting, and its my own fault. I wrote the timeline a couple years ago before I knew much about animation on web pages. The tic marks are all DOM elements that get destroyed, and then parsed from a string to be re-created every time the zoom level changes, which is every animation frame when auto-pan is engaged. I know now that it's about the worst way, performance-wise, to animate it. There are better ways of course, but let's put this branch aside and focus on the new flat-style widgets you've got going in your other two branches. We'll hold onto this autopan code for later, if there's extra time at the end or after GSoC even, we could circle back to this and design re-usable tics or convert this to SVG or Canvas to get some different performance numbers going. |
@emackey Seems good to me. We can definitely come back to this later. |
This has been opened for 4 months, what is the plan? |
We want this change, but we can't take it yet because it's a performance killer (due to the current implementation of the timeline). I was thinking about parking it on a branch, but it's easier to just have it open for now. |
Is this still waiting on a timeline refactor? If so, let's just put it on a branch and reference it from a roadmap. No need to have open pull requests just as reminders. |
Should we park this in a branch? |
Yeah it seems like the timeline re-write is still not a high priority, at least for the project I'm on. I would like to get this going again someday. |
This lives on in macoda's fork and the emackey fork as "TimelineScrubber". |
This pull request attempts to solve #773.
However some guidance regarding the fixes is required.