You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I started using your library, I like what you have implemented. I have a question.
There is an svg border object (this is a cloud in the screenshot), it can have any shape. You can't go beyond it. There are internal objects (in the screenshot it is a rectangle), they can also have any shape.
I want that when I move the inner object, I cannot go beyond the boundaries of the outer one. To do this, I came up with the idea that it is possible to track this in the dragmove function, as you had in the manual-test example, but you use standard shapes there, I can't do that. Therefore, I thought that event stores the coordinates of svg paths in the current position and coordinates to the place where we want to move the object. But I couldn't find it. Are there any fields that store these coordinates?
Or, if you know another way, then I wouldn't mind hearing it. Thanks
.on("dragmove", (e) => {
const { handler, box } = e.detail;
e.preventDefault();
let insideatPossibleFutureCoordinatesPath //something that will give the coordinates of the new paths I'm going to move the object to
const intersections = Intersection.intersect(
ShapeInfo.path(externalBorderPath),
ShapeInfo.path(insideatPossibleFutureCoordinatesPath)
);
if(intersections.status !== "Intersection"){
handler.move(x, y);
}
})
The text was updated successfully, but these errors were encountered:
I thought that event stores the coordinates of svg paths in the current position
The event doesnt store anything. It just gives you the bounding box of the moved object.
You would need to intersect the inside object with the outside object and maybe move the inner object so that it stays inside.
However, that is pretty much nontrivial especially with paths
Hi, I started using your library, I like what you have implemented. I have a question.
There is an svg border object (this is a cloud in the screenshot), it can have any shape. You can't go beyond it. There are internal objects (in the screenshot it is a rectangle), they can also have any shape.
I want that when I move the inner object, I cannot go beyond the boundaries of the outer one. To do this, I came up with the idea that it is possible to track this in the dragmove function, as you had in the manual-test example, but you use standard shapes there, I can't do that. Therefore, I thought that event stores the coordinates of svg paths in the current position and coordinates to the place where we want to move the object. But I couldn't find it. Are there any fields that store these coordinates?
Or, if you know another way, then I wouldn't mind hearing it. Thanks
The text was updated successfully, but these errors were encountered: