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

8.2 equivalent transform of an SVG viewport, slight ambiguity. #766

Open
tatarize opened this issue Dec 15, 2019 · 3 comments
Open

8.2 equivalent transform of an SVG viewport, slight ambiguity. #766

tatarize opened this issue Dec 15, 2019 · 3 comments

Comments

@tatarize
Copy link

8.2 equivalent transform of an SVG viewport, step 7 and 8.

  • If align is not 'none' and meetOrSlice is 'meet', set the larger of scale-x and scale-y to the smaller.

I initially read this to say:

        if align != SVG_VALUE_NONE and meet_or_slice == 'meet':
            scale_x = scale_y = max(scale_x, scale_y)

The phrase larger of scale_x and scale_y sounded like max(scale_x, scale_y) then set that value to the one that wasn't the max the smaller which made sense, because the larger was already set to that. Set the larger value of the variables scale_x and scale_y and set the smaller variable to equal that value. Which is to say both variables have the larger value.

But, debugging clearly takes it to mean min(scale_x, scale_y) Which means I interpreted that wrongly, and it took a few reading for me to see the other way to take it. It means find whether scale_x or scale_y is larger then set the value of that larger variable to the value of the smaller variable. Which is to say both variables have the smaller value.

  • set the larger of scale-x and scale-y to the smaller.
  • Set the register holding the larger value to the equal that of the smaller value.
  • Set the register holding the smaller value equal to the larger value of scale_x or scale_y.

The line:
Otherwise, if align is not 'none' and meetOrSlice is 'slice', set the smaller of scale-x and scale-y to the larger -- Has the same ambiguity. smaller could be smaller value or register containing the smaller value. And larger could equally mean register containing the larger value or the value which is larger.

@gordonwoodhull
Copy link

"Set x to y" is generally not ambiguous in English: it means "set variable x to value y".

I can't think of a case where it means "set value x into variable y" - that sounds awkward. "Put value into variable" maybe.

I'm just a bystander with an interest in the future of SVG. I sympathize, having tripped over similar phrases, but I don't think there is ambiguity here.

@tatarize
Copy link
Author

That isn't ambiguous, but it's not what it says. It says "set the larger of x and y to the smaller." That actually seems to be kind of ambiguous. As I can easily read that to mean set the larger value to the smaller variable, which in this case creates a bug.

@tatarize
Copy link
Author

Since larger of x and y can only be a reference to the value of the variable and not something which strictly speaking identifies it. The word larger there can only refer to the value and programmatically that easily means max(scale-x, scale-y) since that's the larger, but it wants the larger variable given the smaller value. I think it should read:

  • If align is not 'none' and meetOrSlice is 'meet', set the larger variable of scale-x and scale-y to the smaller value.

or:

  • If align is not 'none' and meetOrSlice is 'meet', set scale-x and scale-y to the smaller value

This implies setting the smaller value to itself, but that's pretty unambiguous that it means scale_x = scale_y = min(scale_x,scale_y).

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

No branches or pull requests

2 participants