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

Fix: Focal points are not rounded #18765

Merged
merged 1 commit into from Nov 27, 2019
Merged

Conversation

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Nov 26, 2019

Description

Fixes: #18665

Currently, the focal point is not rounded. That makes the cover block markup contain attributes and styles with many decimal places.
That precision is not required and rounding to two decimal places makes the markup cleaner and reduces some bytes on each cover block created.

How has this been tested?

I added a cover block with an image background.
I used the focal point picker and changed it using the mouse.
I switched to code editor mode, and verified the attributes and markup contained only two decimal places.

Copy link
Contributor

youknowriad left a comment

I do wonder if it's too rounded now, maybe allow 2 more digits but LGTM anyway.

@jorgefilipecosta

This comment has been minimized.

Copy link
Member Author

jorgefilipecosta commented Nov 27, 2019

I do wonder if it's too rounded now, maybe allow 2 more digits but LGTM anyway.

We set a relative position in percentage rounding to two digits makes the percentages integer. The way we set the focus point in a small area probably does not provide a higher precision anyway. I think this precision should be enough, but let us keep an eye if people notice a difference.

@jorgefilipecosta jorgefilipecosta merged commit a29186a into master Nov 27, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@jorgefilipecosta jorgefilipecosta deleted the fix/focal-points-are-not-rounded branch Nov 27, 2019
@geriux geriux mentioned this pull request Dec 4, 2019
1 of 1 task complete
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.