Fix off-by-one causing auto to not be centred

This commit is contained in:
smoogipoo 2020-06-22 20:45:44 +09:00
parent 983f0ada2d
commit 1aec1ea53f
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ protected void AddPoint(Vector2 start, Vector2 end, Vector2 hitPoint, float radi
var rotatedAngle = finalAngle - MathUtils.DegreesToRadians(rotation);
var rotatedCoordinate = -1 * new Vector2((float)Math.Cos(rotatedAngle), (float)Math.Sin(rotatedAngle));
Vector2 localCentre = new Vector2(points_per_dimension) / 2;
Vector2 localCentre = new Vector2(points_per_dimension - 1) / 2;
float localRadius = localCentre.X * inner_portion * normalisedDistance; // The radius inside the inner portion which of the heatmap which the closest point lies.
Vector2 localPoint = localCentre + localRadius * rotatedCoordinate;