mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix node label size calculation
This commit is contained in:
parent
359c0354f6
commit
9ed3a6748a
@ -1759,15 +1759,10 @@ RED.view = (function() {
|
||||
}
|
||||
|
||||
function calculateTextDimensions(str,className,offsetW,offsetH) {
|
||||
var sp = document.createElement("span");
|
||||
sp.className = className;
|
||||
sp.style.position = "absolute";
|
||||
sp.style.top = "-1000px";
|
||||
sp.textContent = (str||"");
|
||||
document.body.appendChild(sp);
|
||||
var w = sp.offsetWidth;
|
||||
var h = sp.offsetHeight;
|
||||
document.body.removeChild(sp);
|
||||
var sp = $('<span>',{class: className,style: "position: absolute; top: -1000px"}).text(str||"").appendTo("#red-ui-editor");
|
||||
var w = sp.width();
|
||||
var h = sp.height();
|
||||
sp.remove();
|
||||
return [offsetW+w,offsetH+h];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user