Open bnchi opened 1 year ago
Damn it. I had to rewrite the positioning logic for paths because we weren't repositioning them correctly after moving them post initial creation. But Fabric doesn't update the actual paths instead it changes a left/top property of them and leave paths as is. I'll continue looking into this now.
This is tricky, my brain is fried thinking of this and trying to get it to work. Fabricjs adds top/left on initial creation but doesn't seem to be useful for positioning initially, but on moving they don't update the path instead they update left and right leaving the path as is. I tried normalizing it by just depending on the left/top to position and always starting the path at 0,0 but that doesn't seem to work since left/top refer to the bounding box and not the first point the path was created at.
I am tempted to look at other solutions other than Fabric.
@bnchi do you wanna give it a try at fixing this?
The alternative is to drop my latest changes and revert back to getting the initial positioning working and disabling moving paths after creation. This would work but would not allow us to do the saved signatures feature. It'll probably be better than what we have now.
This is tricky, my brain is fried thinking of this and trying to get it to work. Fabricjs adds top/left on initial creation but doesn't seem to be useful for positioning initially, but on moving they don't update the path instead they update left and right leaving the path as is. I tried normalizing it by just depending on the left/top to position and always starting the path at 0,0 but that doesn't seem to work since left/top refer to the bounding box and not the first point the path was created at.
I am tempted to look at other solutions other than Fabric.
@bnchi do you wanna give it a try at fixing this?
No I don't think i'm gonna spend time fixing it tbh, let's try this https://github.com/steveruizok/perfect-freehand what do you think ? @mkhatib
I also did some research, maybe http://dmitrybaranovskiy.github.io/raphael/reference.html#Paper.text sounds like a pretty good option and good API docs. It uses svgs
If that's something you'd like to try let me know. Otherwise, I'll take a look soon.
Kinda playing around with building my own annotator - mostly to learn and see if I can build something usable. If you're interested in that let me know I can push the code I have to a private repo (code is still a mess and at the beginning).
If that's something you'd like to try let me know. Otherwise, I'll take a look soon.
Kinda playing around with building my own annotator - mostly to learn and see if I can build something usable. If you're interested in that let me know I can push the code I have to a private repo (code is still a mess and at the beginning).
I'll try to make the sign tool work with the options I gave. I think building an annotator from scratch would be a-lot of fun I'll check it out when you decide to open source it :)
Original drawing :
Signed pdf results :