Publish a pair of floats as a vec2, the joystick's argument type - #24
Open
Jules-GP wants to merge 1 commit into
Open
Publish a pair of floats as a vec2, the joystick's argument type#24Jules-GP wants to merge 1 commit into
Jules-GP wants to merge 1 commit into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds
vec2to the schema vocabulary: two numbers set together, because they areone position rather than two settings.
The client already renders it - a 2D pad plus two spin boxes, with drag, Ctrl
for a finer gesture, wheel and arrow keys - and had nothing producing it. This
is the producing half.
Two decisions, both toward refusing rather than guessing
Only
tuple[float, float]. A three-number tuple is a point and would want adifferent widget; refusing it costs less than publishing a type nothing renders.
The ranges are validated by the SERVER, not merely respected by the pad.
They are the one layout key that reaches
validate(): a request that skips thepanel would otherwise place a patch corner off the arch and be answered with a
success. A mirrored axis is still written by inverting the range
(
x_range: [15, -15]puts 15 at the left end), and validation compares againstthe min and max rather than the declared order.
Verified end to end
An annotation through
describe.py, the generated schema through the server's_argument_spec, andvalidate()refusingy = 9on an axis declared[-5, 5]- naming the axis and the value.scripts/tests72 passed. The server half is a separate branch inslicer-remote-tool-server (315 passed there); this one is inert without it, and
harmless: a tool declaring a vec2 simply fails to load on an older server, the
way any unknown type does.