Comments (5)
const rotate = (e) => {
const rotationValue = Number(e.target.value);
const rotationDifference = rotationValue - imageState.rotate;
if (rotationDifference === 0) {
cropperRef.current.reset();
return;
}
const increment = rotationDifference > 0 ? 1 : -1;
const rotationSteps = Math.abs(rotationDifference);
for (let i = 0; i < rotationSteps; i++) {
cropperRef.current?.rotateImage(increment);
}
setImageState((prevState) => {
return {
...prevState,
rotate: rotationValue,
};
});
};
i have made this.
from react-advanced-cropper.
@Mubasher-Skylinx, there is the react-mobile-cropper based on this library.
You can look at the source of the navigation block. It's slightly complicated, but you can take the important parts for you.
If you make the sandbox, I can try to do something.
from react-advanced-cropper.
https://codesandbox.io/s/flamboyant-fermat-zp538c?file=/src/styles/ImageEditor.css
here is the working example
please can you fix the the zoom functionality. when i zoom beyond to it automatically zoom too much and when i zoom out but not fully using slider it automatically zooms out to full even i haven't reached at left side of slider
and also can you improve my slider code for rotation
from react-advanced-cropper.
@Mubasher-Skylinx, technically, you should do something like this. But the current algorithm of absolute zoom calculation may not fit to your requirements.
from react-advanced-cropper.
This is also good thank you
from react-advanced-cropper.
Related Issues (20)
- Typescript type issue HOT 4
- Zoom in and out doesn't work properly HOT 5
- How can i add filters? like black & white. I see you have given Hue, Staturation sliders. But what about proper filters? HOT 9
- How to handle images that are bigger than the screen HOT 4
- resize work reverse in rtl app HOT 4
- Set default cropping area? HOT 5
- editor.setState() is working? HOT 6
- `parentSelector` to have Cropper working inside iframe HOT 2
- Metadata Getting erased HOT 2
- Replacing CustomBackgroundWrapper with a custom component results in component not working HOT 2
- Works with Remix? HOT 2
- Applying a transform to the preview only HOT 10
- Preview to Canvas? HOT 4
- How to make stencil to minWidth and minHeight.
- Blinking issue with the image on page loads. HOT 2
- Unable to Change Wrapper Color to White HOT 5
- URGENT - Image wrongly sized on Safari HOT 7
- Mouse resizing doesn't work HOT 5
- change the stencilComponent to use an oval instead of a circle or rectangle? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-advanced-cropper.