This increases the accuracy of the drop placement.
There is one minor issue that I have compensated for, which is the canvas scale and how that impacts the initial drag position of the schema from it's icon. At a scale of 1 this is perfectly aligned with the top-left corner of the icon position. Any other scale shifts this position left or right based on how big the scale change is.
I have written a function to compensate for this. It is crude but it works quite well, although not 100% perfect. There is a tiny jump at some scales but I don't think this is a problem.
You can see below that when you first click on the icon to drag the schema it's starting position changes based on the scale:
fixes #453
This increases the accuracy of the drop placement.
There is one minor issue that I have compensated for, which is the canvas scale and how that impacts the initial drag position of the schema from it's icon. At a scale of
1
this is perfectly aligned with the top-left corner of the icon position. Any other scale shifts this position left or right based on how big the scale change is.I have written a function to compensate for this. It is crude but it works quite well, although not 100% perfect. There is a tiny jump at some scales but I don't think this is a problem.
You can see below that when you first click on the icon to drag the schema it's starting position changes based on the scale:
https://github.com/pdfme/pdfme/assets/7068515/fae5daf5-d621-4e13-ba0b-75308f6c5470