Giter Site home page Giter Site logo

Comments (5)

Mubasher-Skylinx avatar Mubasher-Skylinx commented on May 14, 2024
    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.

Norserium avatar Norserium commented on May 14, 2024

@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.

Mubasher-Skylinx avatar Mubasher-Skylinx commented on May 14, 2024

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.

Norserium avatar Norserium commented on May 14, 2024

@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.

Mubasher-Skylinx avatar Mubasher-Skylinx commented on May 14, 2024

This is also good thank you

from react-advanced-cropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.