Hi @SomeoneElse, I saw your code and attempt of repositioning the created path object.
I don’t know if there’s an easier method for this, but I just created a new function for repositioning a path object:
project.position=function(path,posXY){
var diffX = posXY[0]-path.view.item.position.x;
var diffY = posXY[1]-path.view.item.position.y;
var NewSegments = path.json[1].segments;
path.json[1].segments.forEach(function(value,index){
NewSegments[index][0]=[value[0][0]+diffX,value[0][1]+diffY];
});
var A={
"applyMatrix": path.json[1].applyMatrix,
"segments": NewSegments,
"closed": path.json[1].closed,
"fillColor": path.fillColor,
"strokeColor": path.strokeColor,
"strokeCap": path.json[1].strokeCap
};
path.json=["Path",A];
};
After adding this function to your project something like
project.position(path,[0,0]);
should be able to reposition a path object to points (0,0)
Here’s an example where the created path object follows your cursor:
Bug4-10-2022_9-27-37.wick (1.9 KB)
This works by adding the difference in position to the segment points of the path object’s data. The json data was completely redefined in the function, which gives you a chance to adjust other variables along the way. Consider this as a workaround. Let me know if you’re confused or curios about anything else