mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 14:03:22 +08:00
Rename parameter
This commit is contained in:
parent
3180468db1
commit
b54b4063be
@ -50,14 +50,14 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
|
||||
rawScale = convertDragEventToScaleMultiplier(e);
|
||||
|
||||
applyScale(shouldLockAspectRatio: isCornerAnchor(originalAnchor) && e.ShiftPressed, ignoreAnchor: e.AltPressed);
|
||||
applyScale(shouldLockAspectRatio: isCornerAnchor(originalAnchor) && e.ShiftPressed, useDefaultOrigin: e.AltPressed);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
{
|
||||
if (IsDragged)
|
||||
{
|
||||
applyScale(shouldLockAspectRatio: isCornerAnchor(originalAnchor) && e.ShiftPressed, ignoreAnchor: e.AltPressed);
|
||||
applyScale(shouldLockAspectRatio: isCornerAnchor(originalAnchor) && e.ShiftPressed, useDefaultOrigin: e.AltPressed);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
base.OnKeyUp(e);
|
||||
|
||||
if (IsDragged)
|
||||
applyScale(shouldLockAspectRatio: isCornerAnchor(originalAnchor) && e.ShiftPressed, ignoreAnchor: e.AltPressed);
|
||||
applyScale(shouldLockAspectRatio: isCornerAnchor(originalAnchor) && e.ShiftPressed, useDefaultOrigin: e.AltPressed);
|
||||
}
|
||||
|
||||
protected override void OnDragEnd(DragEndEvent e)
|
||||
@ -100,13 +100,13 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
if ((originalAnchor & Anchor.y0) > 0) scale.Y = -scale.Y;
|
||||
}
|
||||
|
||||
private void applyScale(bool shouldLockAspectRatio, bool ignoreAnchor = false)
|
||||
private void applyScale(bool shouldLockAspectRatio, bool useDefaultOrigin = false)
|
||||
{
|
||||
var newScale = shouldLockAspectRatio
|
||||
? new Vector2((rawScale.X + rawScale.Y) * 0.5f)
|
||||
: rawScale;
|
||||
|
||||
Vector2? scaleOrigin = ignoreAnchor ? null : originalAnchor.Opposite().PositionOnQuad(scaleHandler!.OriginalSurroundingQuad!.Value);
|
||||
Vector2? scaleOrigin = useDefaultOrigin ? null : originalAnchor.Opposite().PositionOnQuad(scaleHandler!.OriginalSurroundingQuad!.Value);
|
||||
scaleHandler!.Update(newScale, scaleOrigin, getAdjustAxis());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user