From 0c36b8333e9ab6a89c2ec4eedefc7c2a46cb8bf1 Mon Sep 17 00:00:00 2001 From: Alex Lende Date: Wed, 24 Jun 2020 09:41:26 -0600 Subject: [PATCH] Transform prop and flip demo (#150) Co-authored-by: Valentin Hervieu --- README.md | 1 + docs/src/components/Demo/cropImage.ts | 6 ++- docs/src/components/Demo/index.tsx | 34 +++++++++++++- examples/src/index.tsx | 68 +++++++++++++++++++++++---- examples/src/styles.css | 5 ++ src/index.tsx | 8 +++- 6 files changed, 107 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 5dc6180..78dfe66 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ This component requires some styles to be available in the document. By default, | `onZoomChange` | zoom => void | | Called everytime the zoom is changed. Use it to update your `zoom` state. | | `onRotationChange` | rotation => void | | Called everytime the rotation is changed (with mobile gestures). Use it to update your `rotation` state. | | [`onCropComplete`](#onCropCompleteProp) | Function | | Called when the user stops moving the media or stops zooming. It will be passed the corresponding cropped area on the media in percentages and pixels | +| `transform` | string | | CSS transform to apply to the image in the editor. Defaults to `translate(${crop.x}px, ${crop.y}px) rotate(${rotation}deg) scale(${zoom})` with variables being pulled from props. | | `style` | `{ containerStyle: object, mediaStyle: object, cropAreaStyle: object }` | | Custom styles to be used with the Cropper. Styles passed via the style prop are merged with the defaults. | | `classes` | `{ containerClassName: string, mediaClassName: string, cropAreaClassName: string }` | | Custom class names to be used with the Cropper. Classes passed via the classes prop are merged with the defaults. If you have CSS specificity issues, you should probably use the `disableAutomaticStylesInjection` prop. | | `mediaProps` | object | | The properties you want to apply to the media tag ( or