diff --git a/src/Blazor.Diagrams/Components/NavigatorWidget.razor b/src/Blazor.Diagrams/Components/NavigatorWidget.razor index 57ff9f1b..7bfd1db1 100644 --- a/src/Blazor.Diagrams/Components/NavigatorWidget.razor +++ b/src/Blazor.Diagrams/Components/NavigatorWidget.razor @@ -1,9 +1,9 @@ @if (Diagram.Container != null) { - var addedNodeX = Math.Max(0, Diagram.Pan.X); - var addedNodeY = Math.Max(0, Diagram.Pan.Y); - var addedCurrentViewX = Math.Abs(Math.Min(0, Diagram.Pan.X)) * XFactor; - var addedCurrentViewY = Math.Abs(Math.Min(0, Diagram.Pan.Y)) * YFactor; + var addedNodeX = Math.Max(0, Diagram.Pan.X) + NodePositionAdjustment.X; + var addedNodeY = Math.Max(0, Diagram.Pan.Y) + NodePositionAdjustment.Y; + var addedCurrentViewX = (Math.Abs(Math.Min(0, Diagram.Pan.X)) + NodePositionAdjustment.X) * XFactor; + var addedCurrentViewY = (Math.Abs(Math.Min(0, Diagram.Pan.Y)) + NodePositionAdjustment.Y) * YFactor; var currentViewWidth = Diagram.Container.Width * XFactor; var currentViewHeight = Diagram.Container.Height * YFactor; @@ -13,18 +13,19 @@ style="top: @(addedCurrentViewY.ToInvariantString())px; left: @(addedCurrentViewX.ToInvariantString())px; width: @(currentViewWidth.ToInvariantString())px; - height: @(currentViewHeight.ToInvariantString())px;"> + height: @(currentViewHeight.ToInvariantString())px; + border: 2px solid @FillColor;"> @foreach (var node in Diagram.Nodes.Where(n => n.Size != null)) { - var left = (Math.Max(0, node.Position.X * Diagram.Zoom) + addedNodeX) * XFactor; - var top = (Math.Max(0, node.Position.Y * Diagram.Zoom) + addedNodeY) * YFactor; + var left = ((node.Position.X * Diagram.Zoom) + addedNodeX) * XFactor; + var top = ((node.Position.Y * Diagram.Zoom) + addedNodeY) * YFactor; var width = node.Size.Width * Diagram.Zoom * XFactor; var height = node.Size.Height * Diagram.Zoom * YFactor; - @@ -38,7 +39,7 @@ var height = group.Size.Height * Diagram.Zoom * YFactor; -