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

Cover Block: Fix focal point error when the Featured Image is applied #40643

Conversation

ndiego
Copy link
Member

@ndiego ndiego commented Apr 27, 2022

What?

There was a bug in the implementation of the Featured Image support. On the frontend, the x value for the focal point was set for both x and y. This PR corrects that.

Why?

Focal point would not work otherwise when the Cover Block was set to display the Featured Image.

How?

Simply replace the incorrect "x" with "y".

Testing Instructions

  1. Insert a Cover block, set to display the Featured Image and ensure the page/post has a featured image
  2. Modify the focal point on the image
  3. Check the Frontend to make sure it looks like the Editor

Screenshots or screencast

Editor
image

Before
image

After
image

@ndiego ndiego requested a review from ajitbohra as a code owner April 27, 2022 10:21
@ndiego ndiego added [Type] Bug An existing feature does not function as intended [Block] Cover Affects the Cover Block - used to display content laid over a background image labels Apr 27, 2022
@ndiego ndiego requested review from Mamaduka and draganescu April 27, 2022 10:21
@ndiego
Copy link
Member Author

ndiego commented Apr 27, 2022

This should be an easy one for backport consideration. Fixes a bug related to the new Featured Image support in Cover blocks coming in 6.0. Testing and review appreciated 🙏

Copy link
Member

@fabiankaegy fabiankaegy left a 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 🚀 Works as intended

@getdave getdave requested a review from adamziel April 27, 2022 10:42
@ndiego
Copy link
Member Author

ndiego commented Apr 27, 2022

Thanks @fabiankaegy, will 🚢 once checks pass.

@ndiego ndiego added the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Apr 27, 2022
@ndiego ndiego merged commit ed7482d into WordPress:trunk Apr 27, 2022
@ndiego ndiego deleted the fix/focal-point-on-featured-image-in-cover-block branch April 27, 2022 11:32
@github-actions github-actions bot added this to the Gutenberg 13.2 milestone Apr 27, 2022
@adamziel
Copy link
Contributor

I cherry picked this change into wp/6.0 branch to be included in WordPress 6.0 Beta 4 on Monday: 8a26638

@adamziel adamziel removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Apr 29, 2022
@femkreations femkreations added the Needs User Documentation Needs new user documentation label Aug 22, 2022
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 Needs User Documentation Needs new user documentation [Type] Bug An existing feature does not function as intended
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants