Skip to content
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

[feature request] Resume moveable object after destroy method #71

Closed
tissi-2 opened this issue Oct 25, 2019 · 4 comments
Closed

[feature request] Resume moveable object after destroy method #71

tissi-2 opened this issue Oct 25, 2019 · 4 comments
Labels
question Further information is requested

Comments

@tissi-2
Copy link

tissi-2 commented Oct 25, 2019

I would like to resume dragging, scaling and roatating the target after having called the destroy method. Is it possible with and without going back to the original state? I kind of think of a

  1. reset method that restores the original place, orientation and scale of the moveable object
  2. method that makes the object moveable again with the current place and orientation and scale
@daybrush daybrush added the question Further information is requested label Oct 26, 2019
@daybrush
Copy link
Owner

@tissi-2
In moveable, the rotation, scale, and translate values are not known. Only the user knows.

The moveable only knows the computed transform and only needs to set the target without having to resume it.

If you have an example of CodePen, I will help you.

@tissi-2
Copy link
Author

tissi-2 commented Oct 26, 2019 via email

@daybrush
Copy link
Owner

daybrush commented Nov 1, 2019

@tissi-2

It's still an experimental method. But you can use it.

const rectInfo = moveable.getRect();

export interface RectInfo {
    pos1: number[];
    pos2: number[];
    pos3: number[];
    pos4: number[];
    left: number;
    top: number;
    width: number;
    height: number;
}

@andreasvirkus
Copy link

I think it's possible to set the moveable.target to null to temporarily disable and then to set the same (original) target again when you need to continue from the same position, no?

@daybrush daybrush closed this as completed Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants