Merge pull request #2829 from tom-arrow/reverse-arrow-fix

Fix reverse arrow displayed with incorrect angle
This commit is contained in:
Dean Herbert 2018-06-19 20:17:16 +09:00 committed by GitHub
commit b9d63ee7b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Objects.Drawables;
using OpenTK;
using osu.Game.Graphics;
@ -89,7 +90,7 @@ public void UpdateSnakingPosition(Vector2 start, Vector2 end)
// find the next vector2 in the curve which is not equal to our current position to infer a rotation.
for (int i = searchStart; i >= 0 && i < curve.Count; i += direction)
{
if (curve[i] == Position)
if (Precision.AlmostEquals(curve[i], Position))
continue;
Rotation = MathHelper.RadiansToDegrees((float)Math.Atan2(curve[i].Y - Position.Y, curve[i].X - Position.X));