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

Conversation

jorgefilipecosta
Copy link
Member

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.

@jorgefilipecosta jorgefilipecosta added [Type] Enhancement A suggestion for improvement. [Block] Cover Affects the Cover Block - used to display content laid over a background image labels Nov 26, 2019
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@jorgefilipecosta
Copy link
Member Author

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.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cover block focal points rounding
2 participants