mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 03:22: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[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Position = centrePosition,
|
Position = centrePosition,
|
||||||
Width = Math.Min(10, DistanceSpacing * 2),
|
Width = crosshair_thickness,
|
||||||
Height = 2,
|
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