1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:18:22 +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() private void updateState()
{ {
var quad = GeometryUtils.GetSurroundingQuad(selectedMovableObjects); var quad = GeometryUtils.GetSurroundingQuad(selectedMovableObjects);
CanRotateSelectionOrigin.Value = quad.Width > 0 || quad.Height > 0; CanRotateFromSelectionOrigin.Value = quad.Width > 0 || quad.Height > 0;
CanRotatePlayfieldOrigin.Value = selectedMovableObjects.Any(); CanRotateFromPlayfieldOrigin.Value = selectedMovableObjects.Any();
} }
private OsuHitObject[]? objectsInRotation; private OsuHitObject[]? objectsInRotation;

View File

@ -53,8 +53,8 @@ namespace osu.Game.Rulesets.Osu.Edit
CanScaleX.Value = quad.Width > 0; CanScaleX.Value = quad.Width > 0;
CanScaleY.Value = quad.Height > 0; CanScaleY.Value = quad.Height > 0;
CanScaleDiagonally.Value = CanScaleX.Value && CanScaleY.Value; CanScaleDiagonally.Value = CanScaleX.Value && CanScaleY.Value;
CanScaleSelectionOrigin.Value = CanScaleX.Value || CanScaleY.Value; CanScaleFromSelectionOrigin.Value = CanScaleX.Value || CanScaleY.Value;
CanScalePlayfieldOrigin.Value = selectedMovableObjects.Any(); CanScaleFromPlayfieldOrigin.Value = selectedMovableObjects.Any();
} }
private Dictionary<OsuHitObject, OriginalHitObjectState>? objectsInScale; 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 }); angleInput.Current.BindValueChanged(angle => rotationInfo.Value = rotationInfo.Value with { Degrees = angle.NewValue });
rotationOrigin.Items.First().Select(); rotationOrigin.Items.First().Select();
rotationHandler.CanRotateSelectionOrigin.BindValueChanged(e => rotationHandler.CanRotateFromSelectionOrigin.BindValueChanged(e =>
{ {
selectionCentreButton.Selected.Disabled = !e.NewValue; selectionCentreButton.Selected.Disabled = !e.NewValue;
}, true); }, true);

View File

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

View File

@ -64,15 +64,15 @@ namespace osu.Game.Rulesets.Osu.Edit
base.LoadComplete(); base.LoadComplete();
// aggregate two values into canRotate // aggregate two values into canRotate
canRotatePlayfieldOrigin = RotationHandler.CanRotatePlayfieldOrigin.GetBoundCopy(); canRotatePlayfieldOrigin = RotationHandler.CanRotateFromPlayfieldOrigin.GetBoundCopy();
canRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate()); canRotatePlayfieldOrigin.BindValueChanged(_ => updateCanRotateAggregate());
canRotateSelectionOrigin = RotationHandler.CanRotateSelectionOrigin.GetBoundCopy(); canRotateSelectionOrigin = RotationHandler.CanRotateFromSelectionOrigin.GetBoundCopy();
canRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate()); canRotateSelectionOrigin.BindValueChanged(_ => updateCanRotateAggregate());
void updateCanRotateAggregate() void updateCanRotateAggregate()
{ {
canRotate.Value = RotationHandler.CanRotatePlayfieldOrigin.Value || RotationHandler.CanRotateSelectionOrigin.Value; canRotate.Value = RotationHandler.CanRotateFromPlayfieldOrigin.Value || RotationHandler.CanRotateFromSelectionOrigin.Value;
} }
// aggregate three values into canScale // aggregate three values into canScale
@ -82,12 +82,12 @@ namespace osu.Game.Rulesets.Osu.Edit
canScaleY = ScaleHandler.CanScaleY.GetBoundCopy(); canScaleY = ScaleHandler.CanScaleY.GetBoundCopy();
canScaleY.BindValueChanged(_ => updateCanScaleAggregate()); canScaleY.BindValueChanged(_ => updateCanScaleAggregate());
canScalePlayfieldOrigin = ScaleHandler.CanScalePlayfieldOrigin.GetBoundCopy(); canScalePlayfieldOrigin = ScaleHandler.CanScaleFromPlayfieldOrigin.GetBoundCopy();
canScalePlayfieldOrigin.BindValueChanged(_ => updateCanScaleAggregate()); canScalePlayfieldOrigin.BindValueChanged(_ => updateCanScaleAggregate());
void 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 // 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; this.getTargetContainer = getTargetContainer;
CanRotateSelectionOrigin.Value = true; CanRotateFromSelectionOrigin.Value = true;
} }
[CanBeNull] [CanBeNull]

View File

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

View File

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

View File

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

View File

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