Advertisement
Guest User

Untitled

a guest
Sep 14th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while (boxHeight > 200) {
  2.             fontSize -= 1;
  3.             b_box = font.getPath(description, 0, 0, fontSize).getBoundingBox()
  4.             boxWidth = b_box.x2 - b_box.x1;
  5.             while (boxWidth < (width - 100)) {
  6.               numOfChars += 1;
  7.               description = wrap(quiz.description, { width: numOfChars });
  8.               descriptionArr = description.split('\n');
  9.               line_b_box = font.getPath(Math.max(descriptionArr), 0, 0, fontSize).getBoundingBox()
  10.               boxWidth = b_box.x2 - b_box.x1;
  11.             }
  12.             b_box = font.getPath(description, 0, 0, fontSize).getBoundingBox()
  13.             boxHeight = descriptionArr.length * (b_box.y2 - b_box.y1);
  14.           }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement