From 2b1c6dc81d6908fa76099d3b72ae825f4f027d1a Mon Sep 17 00:00:00 2001 From: Lev Nachmanson <5377127+levnach@users.noreply.github.com> Date: Mon, 22 Jul 2024 12:53:59 -1000 Subject: [PATCH] Update GraphViewer.cs Set GeometryLabel --- GraphLayout/tools/WpfGraphControl/GraphViewer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GraphLayout/tools/WpfGraphControl/GraphViewer.cs b/GraphLayout/tools/WpfGraphControl/GraphViewer.cs index 80ab850f..31b8aaf0 100644 --- a/GraphLayout/tools/WpfGraphControl/GraphViewer.cs +++ b/GraphLayout/tools/WpfGraphControl/GraphViewer.cs @@ -1439,6 +1439,11 @@ static TextBlock CreateTextBlock(Label drawingLabel) { textBlock.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); textBlock.Width = textBlock.DesiredSize.Width; textBlock.Height = textBlock.DesiredSize.Height; + if (drawingLabel.GeometryLabel == null) { + drawingLabel.GeometryLabel = new Core.Layout.Label(); + } + drawingLabel.GeometryLabel.Width = textBlock.Width; + drawingLabel.GeometryLabel.Height = textBlock.Height; return textBlock; } @@ -1729,4 +1734,4 @@ void MakeRoomForNewNode(Drawing.Node drawingNode) { public bool IncrementalDraggingModeAlways { get; set; } public bool CreateToolTipForNodes { get => createToolTipForNodes; private set => createToolTipForNodes = value; } } -} \ No newline at end of file +}