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
Update: Round position attributes on cover focal point save #19183
Merged
Conversation
This file contains 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
jorgefilipecosta added [Type] Enhancement
A suggestion for improvement.
[Block] Cover
Affects the Cover Block - used to display content laid over a background image
labels
Dec 16, 2019
jorgefilipecosta requested review from ajitbohra, nerrad, ntwb, Soean and talldan as code owners
December 16, 2019 20:51
Tested this locally and can verify that it works as advertised for both existing saved block content with unrounded %s, and with new blocks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @jorgefilipecosta! This works great on my tests, with both new and existing cover blocks.
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover
Affects the Cover Block - used to display content laid over a background image
[Type] Enhancement
A suggestion for improvement.
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.
Description
As @mmtr noted in #18665 (comment), the rounding problem on the cover block was not totally fixed. During the save we should also round the value.
This PR fixes the problem and introduces the deprecation logic to keep current blocks valid.
How has this been tested?
On the master branch, I inserted a cover block with an image background.
I set the focal point coordinates to seven.
I checked on the code view that the background-position was "7.000000000000001%".
I saved the post.
I switched to this branch and reloaded the post.
I verified the block was still valid and in the code editor, I verified the background-position was now 7%.
I inserted another block with 7 as the focal point position and verified in the code editor that the position was 7%.