File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
apps/OpenSign/src/constant Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1319,11 +1319,12 @@ export const multiSignEmbed = async (
1319
1319
let currentLine = "" ;
1320
1320
1321
1321
for ( const word of textContent . split ( " " ) ) {
1322
+ //get text line width
1322
1323
const lineWidth = font . widthOfTextAtSize (
1323
1324
`${ currentLine } ${ word } ` ,
1324
1325
fontSize
1325
1326
) ;
1326
-
1327
+ //check text content line width is less or equal to container width
1327
1328
if ( lineWidth <= width ) {
1328
1329
currentLine += ` ${ word } ` ;
1329
1330
} else {
@@ -1338,13 +1339,9 @@ export const multiSignEmbed = async (
1338
1339
// Function to break text into lines based on when user go next line on press enter button
1339
1340
const breakTextIntoLines = ( textContent , width ) => {
1340
1341
const lines = [ ] ;
1341
- let currentLine = "" ;
1342
1342
1343
1343
for ( const word of textContent . split ( "\n" ) ) {
1344
- const lineWidth = font . widthOfTextAtSize (
1345
- `${ currentLine } ${ word } ` ,
1346
- fontSize
1347
- ) ;
1344
+ const lineWidth = font . widthOfTextAtSize ( `${ word } ` , fontSize ) ;
1348
1345
//checking string length to container width
1349
1346
//if string length is less then container width it means user press enter button
1350
1347
if ( lineWidth <= width ) {
You can’t perform that action at this time.
0 commit comments