-
Notifications
You must be signed in to change notification settings - Fork 63
feat(components/molecule/imageEditor): Add a preview mode to molecule/imageEditor to optimize image #2290
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
Conversation
…/imageEditor to optimize image
|
| MoleculeImageEditor.displayName = 'MoleculeImageEditor' | ||
| MoleculeImageEditor.propTypes = { | ||
| aspect: PropTypes.number, | ||
| previewOnlyMode: PropTypes.bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| previewOnlyMode: PropTypes.bool, | |
| isPreviewMode: PropTypes.bool, |
or even
| previewOnlyMode: PropTypes.bool, | |
| isPreview: PropTypes.bool, |
given they're boolean props. What do you think...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good stuff 👏
as per our conversation, though, perhaps it's a bit too hacky and we may find a good use case for a debounce here...
|
Molecule/ImageEditor
❓ AskTypes of changes
Description, Motivation and Context
ImageEditor is currently calculating a new image every time the user makes zoom or rotates an image. Which, with a normal use, could happen between 50 and 100 times just by sliding the zoom or rotation slide.
This is causing a bad performance. Additionally, as we don't know which is the final calculated image, we're not sure when the
savebutton of our web-app can be enabled to finish the process.To solve this problematic, this proposal debounces the execution of some critical functions, to ensure that image is calculate just when needed.
Co-authored with @andresin87
Screenshots - Animations
There aren't visual changes.