1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 03:35:35 +08:00

rename CanScaleSelectionOrigin/PlayfieldOrigin to make clear its not the origin being scaled

This commit is contained in:
OliBomby 2024-05-28 16:14:16 +02:00
parent 36453f6215
commit a89ba33b47
10 changed files with 18 additions and 18 deletions

View File

@ -41,8 +41,8 @@ namespace osu.Game.Rulesets.Osu.Edit
private void updateState()
{
var quad = GeometryUtils.GetSurroundingQuad(selectedMovableObjects);
CanRotateSelectionOrigin.Value = quad.Width > 0 || quad.Height > 0;
CanRotatePlayfieldOrigin.Value = selectedMovableObjects.Any();
CanRotateFromSelectionOrigin.Value = quad.Width > 0 || quad.Height > 0;
CanRotateFromPlayfieldOrigin.Value = selectedMovableObjects.Any();
}
private OsuHitObject[]? objectsInRotation;

View File

@ -53,8 +53,8 @@ namespace osu.Game.Rulesets.Osu.Edit
CanScaleX.Value = quad.Width > 0;
CanScaleY.Value = quad.Height > 0;
CanScaleDiagonally.Value = CanScaleX.Value && CanScaleY.Value;
CanScaleSelectionOrigin.Value = CanScaleX.Value || CanScaleY.Value;
CanScalePlayfieldOrigin.Value = selectedMovableObjects.Any();
CanScaleFromSelectionOrigin.Value = CanScaleX.Value || CanScaleY.Value;
CanScaleFromPlayfieldOrigin.Value = selectedMovableObjects.Any();
}
private Dictionary<OsuHitObject, OriginalHitObjectState>? objectsInScale;

View File

@ -86,7 +86,7 @@ namespace osu.Game.Rulesets.Osu.Edit
angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
rotationOrigin.Items.First().Select();
rotationHandler.CanRotateSelectionOrigin.BindValueChanged(e =>
rotationHandler.CanRotateFromSelectionOrigin.BindValueChanged(e =>
{
selectionCentreButton.Selected.Disabled = !e.NewValue;
}, true);

View File

@ -118,7 +118,7 @@ namespace osu.Game.Rulesets.Osu.Edit
xCheckBox.Current.BindValueChanged(x => setAxis(x.NewValue, yCheckBox.Current.Value));
yCheckBox.Current.BindValueChanged(y => setAxis(xCheckBox.Current.Value, y.NewValue));
scaleHandler.CanScaleSelectionOrigin.BindValueChanged(e =>
scaleHandler.CanScaleFromSelectionOrigin.BindValueChanged(e =>
{
selectionCentreButton.Selected.Disabled = !e.NewValue;
}, true);

View File

@ -64,15 +64,15 @@ namespace osu.Game.Rulesets.Osu.Edit
base.LoadComplete();
// aggregate two values into canRotate
canRotatePlayfieldOrigin = RotationHandler.CanRotatePlayfieldOrigin.GetBoundCopy();
canRotatePlayfieldOrigin = RotationHandler.CanRotateFromPlayfieldOrigin.GetBoundCopy();
canRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate());
canRotateSelectionOrigin = RotationHandler.CanRotateSelectionOrigin.GetBoundCopy();
canRotateSelectionOrigin = RotationHandler.CanRotateFromSelectionOrigin.GetBoundCopy();
canRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate());
void updateCanRotateAggregate()
{
canRotate.Value = RotationHandler.CanRotatePlayfieldOrigin.Value || RotationHandler.CanRotateSelectionOrigin.Value;
canRotate.Value = RotationHandler.CanRotateFromPlayfieldOrigin.Value || RotationHandler.CanRotateFromSelectionOrigin.Value;
}
// aggregate three values into canScale
@ -82,12 +82,12 @@ namespace osu.Game.Rulesets.Osu.Edit
canScaleY = ScaleHandler.CanScaleY.GetBoundCopy();
canScaleY.BindValueChanged(_ => updateCanScaleAggregate());
canScalePlayfieldOrigin = ScaleHandler.CanScalePlayfieldOrigin.GetBoundCopy();
canScalePlayfieldOrigin = ScaleHandler.CanScaleFromPlayfieldOrigin.GetBoundCopy();
canScalePlayfieldOrigin.BindValueChanged(_ => updateCanScaleAggregate());
void updateCanScaleAggregate()
{
canScale.Value = ScaleHandler.CanScaleX.Value || ScaleHandler.CanScaleY.Value || ScaleHandler.CanScalePlayfieldOrigin.Value;
canScale.Value = ScaleHandler.CanScaleX.Value || ScaleHandler.CanScaleY.Value || ScaleHandler.CanScaleFromPlayfieldOrigin.Value;
}
// bindings to `Enabled` on the buttons are decoupled on purpose

View File

@ -69,7 +69,7 @@ namespace osu.Game.Tests.Visual.Editing
{
this.getTargetContainer = getTargetContainer;
CanRotateSelectionOrigin.Value = true;
CanRotateFromSelectionOrigin.Value = true;
}
[CanBeNull]

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.SkinEditor
private void updateState()
{
CanRotateSelectionOrigin.Value = selectedItems.Count > 0;
CanRotateFromSelectionOrigin.Value = selectedItems.Count > 0;
}
private Drawable[]? objectsInRotation;

View File

@ -127,7 +127,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void load()
{
if (rotationHandler != null)
canRotate.BindTo(rotationHandler.CanRotateSelectionOrigin);
canRotate.BindTo(rotationHandler.CanRotateFromSelectionOrigin);
if (scaleHandler != null)
{

View File

@ -15,12 +15,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <summary>
/// Whether rotation anchored by the selection origin can currently be performed.
/// </summary>
public Bindable<bool> CanRotateSelectionOrigin { get; private set; } = new BindableBool();
public Bindable<bool> CanRotateFromSelectionOrigin { get; private set; } = new BindableBool();
/// <summary>
/// Whether rotation anchored by the center of the playfield can currently be performed.
/// </summary>
public Bindable<bool> CanRotatePlayfieldOrigin { get; private set; } = new BindableBool();
public Bindable<bool> CanRotateFromPlayfieldOrigin { get; private set; } = new BindableBool();
/// <summary>
/// Performs a single, instant, atomic rotation operation.

View File

@ -35,12 +35,12 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <summary>
/// Whether scaling anchored by the selection origin can currently be performed.
/// </summary>
public Bindable<bool> CanScaleSelectionOrigin { get; private set; } = new BindableBool();
public Bindable<bool> CanScaleFromSelectionOrigin { get; private set; } = new BindableBool();
/// <summary>
/// Whether scaling anchored by the center of the playfield can currently be performed.
/// </summary>
public Bindable<bool> CanScalePlayfieldOrigin { get; private set; } = new BindableBool();
public Bindable<bool> CanScaleFromPlayfieldOrigin { get; private set; } = new BindableBool();
public Quad? OriginalSurroundingQuad { get; protected set; }