Fix naming and comment typos

This commit is contained in:
Dean Herbert
2022-08-26 15:56:47 +09:00
parent d98357aa57
commit 23efec6505
2 changed files with 11 additions and 14 deletions

View File

@ -10,9 +10,9 @@ using System;
namespace osu.Game.Graphics.Containers namespace osu.Game.Graphics.Containers
{ {
/// <summary> /// <summary>
/// A container that prevents itself and its children from getting rotated, scaled or flipped with its Parent. /// A container that reverts any rotation (and optionally scale) applied by its direct parent.
/// </summary> /// </summary>
public class UprightUnstretchedContainer : Container public class UprightAspectMaintainingContainer : Container
{ {
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
private readonly Container content; private readonly Container content;
@ -20,16 +20,15 @@ namespace osu.Game.Graphics.Containers
/// <summary> /// <summary>
/// Controls how much this container scales compared to its parent (default is 1.0f). /// Controls how much this container scales compared to its parent (default is 1.0f).
/// </summary> /// </summary>
public float ScalingFactor { get; set; } public float ScalingFactor { get; set; } = 1;
/// <summary> /// <summary>
/// Controls the scaling of this container. /// Controls the scaling of this container.
/// </summary> /// </summary>
public ScaleMode Scaling { get; set; } public ScaleMode Scaling { get; set; } = ScaleMode.Vertical;
public UprightUnstretchedContainer() public UprightAspectMaintainingContainer()
{ {
Scaling = ScaleMode.NoScaling;
InternalChild = content = new GrowToFitContainer(); InternalChild = content = new GrowToFitContainer();
AddLayout(layout); AddLayout(layout);
} }
@ -52,7 +51,7 @@ namespace osu.Game.Graphics.Containers
/// </summary> /// </summary>
private void keepUprightAndUnstretched() private void keepUprightAndUnstretched()
{ {
// Decomposes the inverse of the parent FrawInfo.Matrix into rotation, shear and scale. // Decomposes the inverse of the parent DrawInfo.Matrix into rotation, shear and scale.
var parentMatrix = Parent.DrawInfo.Matrix; var parentMatrix = Parent.DrawInfo.Matrix;
// Remove Translation. // Remove Translation.
@ -130,14 +129,12 @@ namespace osu.Game.Graphics.Containers
NoScaling, NoScaling,
/// <summary> /// <summary>
/// Scale This container (vertically and horizontally) with the vertical axis of its parent /// Scale uniformly (maintaining aspect ratio) based on the vertical scale of the parent.
/// preserving the aspect ratio of the container.
/// </summary> /// </summary>
Vertical, Vertical,
/// <summary> /// <summary>
/// Scales This container (vertically and horizontally) with the horizontal axis of its parent /// Scale uniformly (maintaining aspect ratio) based on the horizontal scale of the parent.
/// preserving the aspect ratio of the container.
/// </summary> /// </summary>
Horizontal, Horizontal,
} }

View File

@ -55,7 +55,7 @@ namespace osu.Game.Screens.Play.HUD
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = new UprightUnstretchedContainer Child = new UprightAspectMaintainingContainer
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -76,7 +76,7 @@ namespace osu.Game.Screens.Play.HUD
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = new UprightUnstretchedContainer Child = new UprightAspectMaintainingContainer
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
@ -97,7 +97,7 @@ namespace osu.Game.Screens.Play.HUD
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Child = new UprightUnstretchedContainer Child = new UprightAspectMaintainingContainer
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,