daily pastebin goal
79%
SHARE
TWEET

Untitled

a guest Sep 14th, 2018 55 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.           }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top