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

Fix skewed timeline for family events #36

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TJBFTV
Copy link

@TJBFTV TJBFTV commented Feb 9, 2025

The timeline for a family gets progressively skewed.

skewed before

The reason is that the timeline attach points are calculated on the entire vertical span. For a family, they should be calculated on the span only from time 0 (marriage or fallback) to the bottom.

This PR aligns the timeline attach points correctly, see the results below.

skewed after

For discussion of the code in the PR, I acknowledge that the first two statements after the comments (in the code) could be moved outside the loop, as they do not use or affect anything that changes within the loop. That would very slightly improve performance. However, that is balanced against executing those two statements uselessly for each person timeline, diluting the overall performance issue. My coding style is to keep those two statements together with the other calculations, for better understanding of the code and for potential future maintenance.

@ztlxltl Ready for your review and comments or merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant