[FIX] web: show the name fully in signature sign item

Issue:
======
The auto signature has hidden overflow part in y axis when having long
characters in bottom like (y, j, g)

Steps to reproduce the issue:
=============================
- Use any sign template that have at least one name_and_signature sign
  item.
- Enter a name that have at least one of the characters (y,j,g)
- Click on auto
- The signature doesn't show fully

Solution:
=========
Update the hardcoded values for the y-axis for the name and the line of
signature and the font size to make sure it fits perfectly inside the
canvas.

opw-3639171

closes odoo/odoo#148299

X-original-commit: c9653d5649a35640cc461c9baa0b73e8c6c1cace
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Mahdi Cheikh Rouhou (macr)
2024-01-05 15:14:36 +00:00
parent 1dc42bc66f
commit e05dbe37e5
2 changed files with 2 additions and 2 deletions
@@ -6,7 +6,7 @@
.o_signature_stroke {
position: absolute;
border-top: #D1D0CE solid 2px;
bottom: 16%;
bottom: 33%;
width: 72%;
left: 14%;
}
@@ -29,7 +29,7 @@
</style>
</defs>
<!-- adapt textLength to prevent distortion and left overflow with small words -->
<text t-esc="text" x="50%" t-att-y="height * 4 / 5" t-att-font-size="height * 4 / 5"
<text t-esc="text" x="50%" t-att-y="height * 3 / 5" t-att-font-size="height * 3 / 5"
t-att-textLength="width * 4 / 5 * (type === 'signature' ? Math.min(1, text.length / 7) : 1)"
t-att-lengthAdjust="'spacing' + (type === 'signature' ? 'AndGlyphs' : '')"
t-attf-style="font-family:'font'; stroke: none; fill: {{color}};" text-anchor="middle"/>