mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 10:17:19 +08:00
Merge pull request #23247 from peppy/round-editor-rotation
Always round editor rotation to integer values
This commit is contained in:
commit
14af2063e5
@ -100,14 +100,14 @@ namespace osu.Game.Localisation
|
|||||||
public static LocalisableString TimelineTicks => new TranslatableString(getKey(@"timeline_ticks"), @"Ticks");
|
public static LocalisableString TimelineTicks => new TranslatableString(getKey(@"timeline_ticks"), @"Ticks");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "{0:0.0}°"
|
/// "{0:0}°"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString RotationUnsnapped(float newRotation) => new TranslatableString(getKey(@"rotation_unsnapped"), @"{0:0.0}°", newRotation);
|
public static LocalisableString RotationUnsnapped(float newRotation) => new TranslatableString(getKey(@"rotation_unsnapped"), @"{0:0}°", newRotation);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// "{0:0.0}° (snapped)"
|
/// "{0:0}° (snapped)"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString RotationSnapped(float newRotation) => new TranslatableString(getKey(@"rotation_snapped"), @"{0:0.0}° (snapped)", newRotation);
|
public static LocalisableString RotationSnapped(float newRotation) => new TranslatableString(getKey(@"rotation_snapped"), @"{0:0}° (snapped)", newRotation);
|
||||||
|
|
||||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
{
|
{
|
||||||
float oldRotation = cumulativeRotation.Value ?? 0;
|
float oldRotation = cumulativeRotation.Value ?? 0;
|
||||||
|
|
||||||
float newRotation = shouldSnap ? snap(rawCumulativeRotation, snap_step) : rawCumulativeRotation;
|
float newRotation = shouldSnap ? snap(rawCumulativeRotation, snap_step) : MathF.Round(rawCumulativeRotation);
|
||||||
newRotation = (newRotation - 180) % 360 + 180;
|
newRotation = (newRotation - 180) % 360 + 180;
|
||||||
|
|
||||||
cumulativeRotation.Value = newRotation;
|
cumulativeRotation.Value = newRotation;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user