Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (boxHeight > 200) {
- fontSize -= 1;
- b_box = font.getPath(description, 0, 0, fontSize).getBoundingBox()
- boxWidth = b_box.x2 - b_box.x1;
- while (boxWidth < (width - 100)) {
- numOfChars += 1;
- description = wrap(quiz.description, { width: numOfChars });
- descriptionArr = description.split('\n');
- line_b_box = font.getPath(Math.max(descriptionArr), 0, 0, fontSize).getBoundingBox()
- boxWidth = b_box.x2 - b_box.x1;
- }
- b_box = font.getPath(description, 0, 0, fontSize).getBoundingBox()
- boxHeight = descriptionArr.length * (b_box.y2 - b_box.y1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement