This repository has been archived by the owner on Jul 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix Vertical visibility for all item types #2143
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…into vertical-visibility
@yotamberk Can you recommend an example to test this!? |
@mojoaxel It's a little bit hard to see because up until now the items would be visible horizontally even when not in range. I used debugging tools and the devtools to fix this. I can try to ad some kind of example. Give me a few hours =) |
@yotamberk No I thinks that's ok. I ecpect you know what you are doing :-) |
mojoaxel
approved these changes
Oct 17, 2016
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.
Code looks good. Could not proper test it, but makes sense!
@yotamberk Thanks! |
Thanks again =) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
the calculation of every single item's visibility was fixed according to its type.
Vertical visibility is determined only by if the group itself is visible. Only groups that are visible in the timeline will expose there itemSets, then tested for horizontal visibility (for each of the item in these items is in range according to the item's
isVisible
function - differs by item type) and only then rendered to the DOM.Every item has an
isVisible
function that checks if the item is in range. This calculation is different from item type to item type (ok... it is similar to ranged items and background items), and should not be defaulted in theItem
class as mentioned in aTODO
- hence I removed the comment.The calculation for the
msPerPixel
is a simple calculation to insure the true width of box and point items is correct. Because these item types don't have an end time, I use the width of the item + it's start time to simulate it's end point with thewidthInMs
and subtract/add it according toalign
option.