Size wordbubbles to text

This commit is contained in:
2014-06-15 20:02:28 -07:00
parent ebfccecc12
commit cd25c8b066

View File

@@ -625,9 +625,9 @@ function stringSize(str, font)
{
var widths = [];
var height = 0;
str.split("\n").forEach(function() {
var f = font || '12px arial';
var o = $('<div>' + str + '</div>')
var f = font || '12px arial';
str.split("\n").forEach(function(x) {
var o = $('<div>' + x + '</div>')
.css({'position': 'absolute', 'float': 'left', 'visibility': 'hidden', 'font': f})
.appendTo($('body'));
widths.push(o.width());