Open abhimanusharma opened 3 years ago
I am trying to achieve something like this,
inst.fabricObjects.forEach(function(fabricObj, index) { fabricObj.set({ lockMovementX: true, lockMovementY: true, lockScalingX: true, lockScalingY: true, }); });
to stop a user to change the position of iText object or anyother fabric object. In case of item like iText object user should be able to update the text value but not move or scale the object.
I also tried this but now object is still moving.
PDFAnnotate.prototype.loadFromJSON = function(jsonData) { var inst = this; inst.fabricObjects.forEach(function(fabricObj, index){ if (jsonData.length > index) { fabricObj.loadFromJSON(jsonData[index], function () { let fabricObjsJSON = fabricObj.toJSON(); fabricObjsJSON.objects.map(item => { item.lockMovementX = true; item.lockMovementY = true; item.lockScalingX = true; item.lockScalingY = true; return item; }); console.log(fabricObjsJSON); inst.fabricObjectsData[index] = fabricObj.toJSON(); }) } }); }
@RavishaHesh any solution for this?
@abhimanusharma if you still need a solution for this let me know
me, I need a solution for this, THX
I am trying to achieve something like this,
to stop a user to change the position of iText object or anyother fabric object. In case of item like iText object user should be able to update the text value but not move or scale the object.
I also tried this but now object is still moving.