mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 01:02:55 +08:00
Add smoothing and tidy code a touch
This commit is contained in:
parent
c9fec50f63
commit
f61d7e4fbe
@ -19,20 +19,27 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
protected override void CreateContent(Vector2 centrePosition)
|
protected override void CreateContent(Vector2 centrePosition)
|
||||||
{
|
{
|
||||||
AddInternal(new Box
|
const float crosshair_thickness = 1;
|
||||||
{
|
const float crosshair_max_size = 10;
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Position = centrePosition,
|
|
||||||
Width = 2,
|
|
||||||
Height = Math.Min(10, DistanceSpacing * 2),
|
|
||||||
});
|
|
||||||
|
|
||||||
AddInternal(new Box
|
AddRangeInternal(new[]
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
new Box
|
||||||
Position = centrePosition,
|
{
|
||||||
Width = Math.Min(10, DistanceSpacing * 2),
|
Origin = Anchor.Centre,
|
||||||
Height = 2,
|
Position = centrePosition,
|
||||||
|
Width = crosshair_thickness,
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
Height = Math.Min(crosshair_max_size, DistanceSpacing * 2),
|
||||||
|
},
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Position = centrePosition,
|
||||||
|
EdgeSmoothness = new Vector2(1),
|
||||||
|
Width = Math.Min(crosshair_max_size, DistanceSpacing * 2),
|
||||||
|
Height = crosshair_thickness,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
float dx = Math.Max(centrePosition.X, DrawWidth - centrePosition.X);
|
float dx = Math.Max(centrePosition.X, DrawWidth - centrePosition.X);
|
||||||
|
Loading…
Reference in New Issue
Block a user