create field position fix 🐛

This commit is contained in:
Timur Ercan
2023-03-07 16:35:45 +01:00
parent 96c6a592f4
commit 6246161697

View File

@ -8,7 +8,7 @@ export const createField = (
customText = ""
): any => {
var rect = e.target.getBoundingClientRect();
const fieldSize = { width: 192, height: 96 };
const fieldSize = { width: 192, height: 64 };
var newFieldX = e.clientX - rect.left - fieldSize.width / 2; //x position within the element.
var newFieldY = e.clientY - rect.top - fieldSize.height / 2; //y position within the element.
if (newFieldX < 0) newFieldX = 0;