Skip to content

Commit

Permalink
Round properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrabbers committed Jun 13, 2024
1 parent 103322b commit 7d5163c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions BnbnavNetClient/Models/MapBin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public void Insert(Edge edge)
var maxX = int.Max(edge.From.X, edge.To.X);
var maxY = int.Max(edge.From.Z, edge.To.Z);
var edgeBounds = new IntRect(minX, minY, maxX, maxY);
var expandedBounds = edgeBounds.Expand(5);
var startX = (expandedBounds.Left - Bounds.Left) / BinSideLength;
var startY = (expandedBounds.Top - Bounds.Top) / BinSideLength;
var endX = (expandedBounds.Right - Bounds.Left) / BinSideLength;
var endY = (expandedBounds.Top - Bounds.Top) / BinSideLength;
var expanded = edgeBounds.Expand(5);
var startX = (expanded.Left - Bounds.Left - BinSideLength / 2) / BinSideLength;
var startY = (expanded.Top - Bounds.Top - BinSideLength / 2) / BinSideLength;
var endX = (expanded.Right - Bounds.Left + BinSideLength / 2) / BinSideLength;
var endY = (expanded.Bottom - Bounds.Top + BinSideLength / 2) / BinSideLength;

for (var i = startX; i <= endX; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion BnbnavNetClient/Views/MapView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected override void OnInitialized()

var hitTestResultsE = HitTest(eventArgs.GetPosition(this));
var hitTestResults = hitTestResultsE as MapItem[] ?? hitTestResultsE.ToArray();

_pointerVelocities.Clear(); // Make sure we're not using velocities from previous pan.

if (!MapViewModel.IsInEditMode)
Expand Down

0 comments on commit 7d5163c

Please sign in to comment.