Size wordbubbles to text
This commit is contained in:
@@ -625,9 +625,9 @@ function stringSize(str, font)
|
|||||||
{
|
{
|
||||||
var widths = [];
|
var widths = [];
|
||||||
var height = 0;
|
var height = 0;
|
||||||
str.split("\n").forEach(function() {
|
|
||||||
var f = font || '12px arial';
|
var f = font || '12px arial';
|
||||||
var o = $('<div>' + str + '</div>')
|
str.split("\n").forEach(function(x) {
|
||||||
|
var o = $('<div>' + x + '</div>')
|
||||||
.css({'position': 'absolute', 'float': 'left', 'visibility': 'hidden', 'font': f})
|
.css({'position': 'absolute', 'float': 'left', 'visibility': 'hidden', 'font': f})
|
||||||
.appendTo($('body'));
|
.appendTo($('body'));
|
||||||
widths.push(o.width());
|
widths.push(o.width());
|
||||||
|
|||||||
Reference in New Issue
Block a user