mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
create field position fix 🐛
This commit is contained in:
@ -8,7 +8,7 @@ export const createField = (
|
|||||||
customText = ""
|
customText = ""
|
||||||
): any => {
|
): any => {
|
||||||
var rect = e.target.getBoundingClientRect();
|
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 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.
|
var newFieldY = e.clientY - rect.top - fieldSize.height / 2; //y position within the element.
|
||||||
if (newFieldX < 0) newFieldX = 0;
|
if (newFieldX < 0) newFieldX = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user