Coder Social home page Coder Social logo

Comments (5)

HZZformGD avatar HZZformGD commented on June 3, 2024 1

Providing an example image from canva.cn, as follows
image
image

from moveable.

SidIcarus avatar SidIcarus commented on June 3, 2024

Although I'm all for this, I believe this a feature request versus an issue.

from moveable.

bskang-v6x avatar bskang-v6x commented on June 3, 2024

I needed this too, and I implemented it by simply creating a virtual clipped Div and swapping the target of the Moveable. It's a bit cumbersome, but it works.

from moveable.

HZZformGD avatar HZZformGD commented on June 3, 2024

I needed this too, and I implemented it by simply creating a virtual clipped Div and swapping the target of the Moveable. It's a bit cumbersome, but it works.

@bskang-v6x Bro, Could you show me some code plz. i want to know how your code work

from moveable.

bskang-v6x avatar bskang-v6x commented on June 3, 2024

I know this doesn't help the open source community, but I don't think I can release the code because it's being used for private purposes by a group larger than myself.

A simple solution is to use

  1. set "Image's Wrapper" as the Target for the Moveable, not "Image", and set the
  2. if it's "Clipable", add a ClipPath to the Wrapper, and when you're done clipping, change the Moveable's Target to the DOM with the size, coordinates, etc. that you added the ClipPath to the Wrapper.
  3. At this point, any Actions that are clipped will need to do some additional processing to the x, y, w, and h of the original Element in the Background.
  4. you'll need to define the appropriate Transform Matrix for each one, for example (let me know if there's a better way to do this).

I apologize for not being able to help you right away.

from moveable.

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.