diff --git a/cytoscape-fcose.js b/cytoscape-fcose.js index 2f94f75..2c64e1c 100644 --- a/cytoscape-fcose.js +++ b/cytoscape-fcose.js @@ -731,12 +731,10 @@ var coseLayout = function coseLayout(options, spectralResult) { //Attach the label properties to compound if labels will be included in node dimensions if (options.nodeDimensionsIncludeLabels) { if (theChild.isParent()) { - var labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w; - var labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h; - var labelPos = theChild.css("text-valign"); - theNode.labelWidth = labelWidth; - theNode.labelHeight = labelHeight; - theNode.labelPos = labelPos; + theNode.labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).w; + theNode.labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).h; + theNode.labelPosVertical = theChild.css("text-valign"); + theNode.labelPosHorizontal = theChild.css("text-halign"); } } diff --git a/src/fcose/cose.js b/src/fcose/cose.js index a43fa93..86d4154 100644 --- a/src/fcose/cose.js +++ b/src/fcose/cose.js @@ -78,12 +78,10 @@ let coseLayout = function(options, spectralResult){ //Attach the label properties to compound if labels will be included in node dimensions if(options.nodeDimensionsIncludeLabels){ if(theChild.isParent()){ - let labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false }).w; - let labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false }).h; - let labelPos = theChild.css("text-valign"); - theNode.labelWidth = labelWidth; - theNode.labelHeight = labelHeight; - theNode.labelPos = labelPos; + theNode.labelWidth = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).w; + theNode.labelHeight = theChild.boundingBox({ includeLabels: true, includeNodes: false, includeOverlays: false }).h; + theNode.labelPosVertical = theChild.css("text-valign"); + theNode.labelPosHorizontal = theChild.css("text-halign"); } }