Commit 411b96bc authored by Romain Loth's avatar Romain Loth

rendering adjustment: small label boost for highlighted nodes

parent 853162b9
...@@ -93,9 +93,14 @@ SigmaUtils = function () { ...@@ -93,9 +93,14 @@ SigmaUtils = function () {
var fontSize, var fontSize,
prefix = settings('prefix') || '', prefix = settings('prefix') || '',
size = node[prefix + 'size'], size = node[prefix + 'size'],
activeFlag = node['active'] || node.customAttrs['forceLabel'] activeFlag = node['active'] || node.customAttrs['forceLabel'],
neighborFlag = node.customAttrs['highlight'],
labelColor = (settings('labelColor') === 'node') ?
(node.color || settings('defaultNodeColor')) :
settings('defaultLabelColor') ;
// NB active is used in all TW selections // NB active is used in all TW selections
// forceLabel is used in cluster highlighting // forceLabel is used in cluster highlighting
// highlight is used for selection's neighbors or cluster highlighting
let X = node[prefix + 'x'] let X = node[prefix + 'x']
let Y = node[prefix + 'y'] let Y = node[prefix + 'y']
...@@ -176,12 +181,14 @@ SigmaUtils = function () { ...@@ -176,12 +181,14 @@ SigmaUtils = function () {
context.fill(); context.fill();
} }
} }
else if (neighborFlag) {
// larger neighbors or highlight
fontSize *= 1.4
}
context.font = (settings('fontStyle') ? settings('fontStyle') + ' ' : '') + context.font = (settings('fontStyle') ? settings('fontStyle') + ' ' : '') +
fontSize + 'px ' + settings('font'); fontSize + 'px ' + settings('font');
context.fillStyle = (settings('labelColor') === 'node') ? context.fillStyle = labelColor;
(node.color || settings('defaultNodeColor')) :
settings('defaultLabelColor');
context.fillText( context.fillText(
node.label, node.label,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment