Repository navigation
Dimensions Tool: Change the conditions underwhich we display the scale control - #53334
Merged
Merged
Conversation
|
Size Change: +104 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
ajlende
reviewed
Aug 4, 2023
ajlende
reviewed
Aug 4, 2023
| aspectRatio: `${ ratio }`, | ||
| aspectRatio: | ||
| ratio === naturalRatio | ||
| ? undefined |
Contributor
There was a problem hiding this comment.
Does this explicitly need to be 'auto'? In most cases undefined/unset is treated as auto.
Contributor
There was a problem hiding this comment.
The main difference is how it interacts with external CSS. Setting 'auto' will output the inline CSS, overriding the external value; whereas, undefined will output nothing, so it doesn't get overridden.
Contributor
Author
There was a problem hiding this comment.
Looks like you changed it already :)
Contributor
There was a problem hiding this comment.
@scruffian I guess my question is, do you think this should be overridable by external CSS?
Contributor
Author
There was a problem hiding this comment.
I think it's best to leave it unset
ajlende
approved these changes
Aug 7, 2023
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.
What?
Don't show the scale control when aspect ratio is set to "Original".
Why?
This PR changed the way we save the aspect ratio control which means that we save the aspect ratio even when it's set to the natural/original ratio. We shouldn't display the scale control when the aspect ratio is set to original, as it doesn't do anything.
How?
Save the aspect ratio as
autowhen the selected ratio is the same as the natural ratio.Testing Instructions
Screenshots or screencast
Note
I also discovered a bug whereby resizing image that had an aspect ratio set caused the block to crash. This is because the block was saving the aspect ratio as a number instead of a string. I have reverted the aspect ratio we save back to a string.