Skip to content

Commit e78a399

Browse files
fix: remoove unnecessary code
1 parent 34c99ed commit e78a399

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

apps/OpenSign/src/constant/Utils.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,11 +1319,12 @@ export const multiSignEmbed = async (
13191319
let currentLine = "";
13201320

13211321
for (const word of textContent.split(" ")) {
1322+
//get text line width
13221323
const lineWidth = font.widthOfTextAtSize(
13231324
`${currentLine} ${word}`,
13241325
fontSize
13251326
);
1326-
1327+
//check text content line width is less or equal to container width
13271328
if (lineWidth <= width) {
13281329
currentLine += ` ${word}`;
13291330
} else {
@@ -1338,13 +1339,9 @@ export const multiSignEmbed = async (
13381339
// Function to break text into lines based on when user go next line on press enter button
13391340
const breakTextIntoLines = (textContent, width) => {
13401341
const lines = [];
1341-
let currentLine = "";
13421342

13431343
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);
13481345
//checking string length to container width
13491346
//if string length is less then container width it means user press enter button
13501347
if (lineWidth <= width) {

0 commit comments

Comments
 (0)