Interpolating component axis values across the "default" border #46
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.
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.