mirror of
https://github.com/osukey/osukey.git
synced 2025-05-12 00:57:21 +09:00
Reformat again...
This commit is contained in:
parent
a33dfbba25
commit
3c00a7cc51
@ -28,14 +28,16 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
|
|
||||||
protected override bool OnMouseMove(InputState state)
|
protected override bool OnMouseMove(InputState state)
|
||||||
{
|
{
|
||||||
if (cursorRotate && dragging) {
|
if (cursorRotate && dragging)
|
||||||
|
{
|
||||||
Debug.Assert(state.Mouse.PositionMouseDown != null);
|
Debug.Assert(state.Mouse.PositionMouseDown != null);
|
||||||
|
|
||||||
// don't start rotating until we're moved a minimum distance away from the mouse down location,
|
// don't start rotating until we're moved a minimum distance away from the mouse down location,
|
||||||
// else it can have an annoying effect.
|
// else it can have an annoying effect.
|
||||||
startRotation |= Vector2Extensions.Distance(state.Mouse.Position, state.Mouse.PositionMouseDown.Value) > 30;
|
startRotation |= Vector2Extensions.Distance(state.Mouse.Position, state.Mouse.PositionMouseDown.Value) > 30;
|
||||||
|
|
||||||
if (startRotation) {
|
if (startRotation)
|
||||||
|
{
|
||||||
Vector2 offset = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
|
Vector2 offset = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
|
||||||
float degrees = (float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)) + 24.3f;
|
float degrees = (float)MathHelper.RadiansToDegrees(Math.Atan2(-offset.X, offset.Y)) + 24.3f;
|
||||||
|
|
||||||
@ -72,7 +74,8 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
|
|
||||||
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
|
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
|
||||||
{
|
{
|
||||||
if (!state.Mouse.HasMainButtonPressed) {
|
if (!state.Mouse.HasMainButtonPressed)
|
||||||
|
{
|
||||||
dragging = false;
|
dragging = false;
|
||||||
startRotation = false;
|
startRotation = false;
|
||||||
|
|
||||||
@ -126,14 +129,19 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuConfigManager config, TextureStore textures, OsuColour colour)
|
private void load(OsuConfigManager config, TextureStore textures, OsuColour colour)
|
||||||
{
|
{
|
||||||
Children = new Drawable[] {
|
Children = new Drawable[]
|
||||||
cursorContainer = new Container {
|
{
|
||||||
|
cursorContainer = new Container
|
||||||
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[] {
|
Children = new Drawable[]
|
||||||
new Sprite {
|
{
|
||||||
|
new Sprite
|
||||||
|
{
|
||||||
Texture = textures.Get(@"Cursor/menu-cursor"),
|
Texture = textures.Get(@"Cursor/menu-cursor"),
|
||||||
},
|
},
|
||||||
AdditiveLayer = new Sprite {
|
AdditiveLayer = new Sprite
|
||||||
|
{
|
||||||
Blending = BlendingMode.Additive,
|
Blending = BlendingMode.Additive,
|
||||||
Colour = colour.Pink,
|
Colour = colour.Pink,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user