mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-03-23 20:15:16 +00:00
Interface labels - surrounding box when selected
This commit is contained in:
parent
384a51ccea
commit
4259aad348
@ -6,7 +6,7 @@ import { select } from "d3-selection";
|
||||
|
||||
|
||||
export class InterfaceLabelWidget {
|
||||
static SURROUNDING_TEXT_BORDER = 10;
|
||||
static SURROUNDING_TEXT_BORDER = 5;
|
||||
|
||||
private cssFixer: CssFixer;
|
||||
|
||||
@ -91,10 +91,12 @@ export class InterfaceLabelWidget {
|
||||
const text = parent.select<SVGTextElement>('text');
|
||||
const bbox = text.node().getBBox();
|
||||
|
||||
current.attr('width', bbox.width + InterfaceLabelWidget.SURROUNDING_TEXT_BORDER);
|
||||
current.attr('height', bbox.height + InterfaceLabelWidget.SURROUNDING_TEXT_BORDER);
|
||||
current.attr('x', bbox.x - InterfaceLabelWidget.SURROUNDING_TEXT_BORDER);
|
||||
current.attr('y', bbox.y - InterfaceLabelWidget.SURROUNDING_TEXT_BORDER);
|
||||
const border = InterfaceLabelWidget.SURROUNDING_TEXT_BORDER;
|
||||
|
||||
current.attr('width', bbox.width + border*2);
|
||||
current.attr('height', bbox.height + border);
|
||||
current.attr('x', - border);
|
||||
current.attr('y', - bbox.height);
|
||||
});
|
||||
|
||||
labels
|
||||
|
Loading…
x
Reference in New Issue
Block a user