+ <>
{ noticeUI }
@@ -167,7 +266,7 @@ class RichImage extends Component {
maxZoom={ MAX_ZOOM }
crop={ position }
zoom={ zoom }
- aspect={ isPortrait ? 1 / aspect : aspect }
+ aspect={ aspect }
onCropChange={ ( newPosition ) => {
this.setState( {
position: newPosition,
@@ -300,67 +399,17 @@ class RichImage extends Component {
{ ( toggleProps ) => (
-
- this.setState( {
- aspect: 16 / 10,
- } ),
- },
- {
- title: __( '16:9' ),
- isDisabled: inProgress,
- onClick: () =>
- this.setState( {
- aspect: 16 / 9,
- } ),
- },
- {
- title: __( '4:3' ),
- isDisabled: inProgress,
- onClick: () =>
- this.setState( {
- aspect: 4 / 3,
- } ),
- },
- {
- title: __( '3:2' ),
- isDisabled: inProgress,
- onClick: () =>
- this.setState( {
- aspect: 3 / 2,
- } ),
- },
- {
- title: __( '1:1' ),
- isDisabled: inProgress,
- onClick: () =>
- this.setState( {
- aspect: 1,
- } ),
- },
- ] }
+ isDisabled={ inProgress }
+ onClick={ ( newAspect ) => {
+ this.setState( {
+ aspect: newAspect,
+ } );
+ } }
/>
) }
-
- this.setState( ( prev ) => ( {
- isPortrait: ! prev.isPortrait,
- } ) )
- }
- />
@@ -376,7 +425,7 @@ class RichImage extends Component {
) }
-
+ >
);
}
}