Skip to content

Commit

Permalink
Ensure default position of focal point picker control is centered
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Feb 6, 2024
1 parent d9d87ba commit 5af7895
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### Bug Fix

- `FocalPointPicker`: Allow `PointerCircle` to render in a default centered position when x and y coordinates are undefined ([#58592](https://github.com/WordPress/gutenberg/pull/58592)).
- `DateTime`: Add a timezone offset value for display purposes. ([#56682](https://github.com/WordPress/gutenberg/pull/56682)).
- `Placeholder`: Fix Placeholder component padding when body text font size is changed ([#58323](https://github.com/WordPress/gutenberg/pull/58323)).
- `Placeholder`: Fix Global Styles typography settings bleeding into placeholder component ([#58303](https://github.com/WordPress/gutenberg/pull/58303)).
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/focal-point-picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ export function FocalPointPicker( {
};

const focalPointPosition = {
left: x * bounds.width,
top: y * bounds.height,
left: x !== undefined ? x * bounds.width : 0.5 * bounds.width,
top: y !== undefined ? y * bounds.height : 0.5 * bounds.height,
};

const classes = classnames(
Expand Down

0 comments on commit 5af7895

Please sign in to comment.