Skip to content

auto bounds X/Y indepented #77

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

auto bounds X/Y indepented #77

wants to merge 1 commit into from

Conversation

gravl4
Copy link

@gravl4 gravl4 commented Feb 10, 2025

X and Y was link in autobound mode.
problem example:
y 1.0 1.0 1.0
x 17777780000 17777880000 17777980000 (as timestamp in us) autobounds Y is 10000000

X and Y was link in aoutobound mode. 
problem example:
y  1.0 1.0 1.0
x 17777780000 17777880000 17777980000 (as timestamp in us)
autobounds Y is 10000000
@oscargus
Copy link
Contributor

oscargus commented Mar 3, 2025

I see that the current behavior may not make much sense, but the change is basically introducing dead code.

Look at the first change, it will only happen if bounds.width() <= 0. With your change, you use is_valid_x(), which is
self.is_finite_x() && self.width() > 0.0. Hence, is_valid_x() will never be true in this branch, so it will always take the other branch and set it to 1.

One may argue what the "best" width is to set here though. The current guess is that if width is negative or zero, set it to height (which gives an aspect ratio ~ 1), but there are clearly cases where it is a bad choice. On the other hand, always selecting 1, which is the current approach, may be just as bad in some situations.

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.

2 participants