Compare commits

...

2 Commits

Author SHA1 Message Date
722aecda39 chore(git): merge pull request #164 from 154-drawfield-escaping into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 1m17s
Reviewed-on: #164
Reviewed-by: eugene <eugene@nostrdev.com>
2024-08-27 10:29:42 +00:00
2f54184625 fix(drawing): clamp DrawField within img
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 33s
Closes #154
2024-08-23 10:09:29 +02:00
2 changed files with 7 additions and 3 deletions

View File

@ -328,8 +328,10 @@ export const DrawPDFFields = (props: Props) => {
) => { ) => {
const target = customTarget ? customTarget : event.currentTarget const target = customTarget ? customTarget : event.currentTarget
const rect = target.getBoundingClientRect() const rect = target.getBoundingClientRect()
const mouseX = event.clientX - rect.left //x position within the element.
const mouseY = event.clientY - rect.top //y position within the element. // Clamp X Y within the target
const mouseX = Math.min(event.clientX, rect.right) - rect.left //x position within the element.
const mouseY = Math.min(event.clientY, rect.bottom) - rect.top //y position within the element.
return { return {
mouseX, mouseX,
@ -415,6 +417,9 @@ export const DrawPDFFields = (props: Props) => {
}} }}
labelId="counterparts" labelId="counterparts"
label="Counterparts" label="Counterparts"
sx={{
background: 'white'
}}
> >
{users {users
.filter((u) => u.role === UserRole.signer) .filter((u) => u.role === UserRole.signer)

View File

@ -75,7 +75,6 @@
bottom: -60px; bottom: -60px;
min-width: 170px; min-width: 170px;
min-height: 30px; min-height: 30px;
background: #fff;
padding: 5px 0; padding: 5px 0;
} }
} }