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

Interpolating component axis values across the "default" border #46

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

justvanrossum
Copy link
Collaborator

@justvanrossum justvanrossum commented Jul 15, 2024

This fixes #45.

Variable component axis values can interpolate across the "default" border.

For example if an axis goes from 0 to 1000 with the default at 200, a variable
component may interpolate this from 100 to 600. In the VARC table, all axis
values will be normalized to (-1, 0, +1). So 100 would normalize to -0.5 and 600
would normalize to +0.5. But this means that interpolation does not work the
same in the normalized space. For example, the midpoint between -0.5 and +0.5
is 0, but the midpoint between 100 and 600 is 350, which would normalize to
0.1875. This is obviously a problem.

To work around it, we extend either side of the axis so the distance between
minValue and defaultValue becomes the same as the distance between defaultValue
and maxValue.

The downside of this approach is that axis values will no longer be clipped to
their original minimum or maximum, so we may create new edge cases here.

@justvanrossum justvanrossum merged commit c9da4b0 into main Jul 15, 2024
4 checks passed
@justvanrossum justvanrossum deleted the axis-scale-issue-45 branch July 15, 2024 17:35
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.

Bug with variable components using "asymmetrical" axes
1 participant