code cleanup
This commit is contained in:
parent
47ea480b18
commit
85274034f3
1 changed files with 13 additions and 13 deletions
|
@ -800,14 +800,14 @@ namespace Sledgemapper
|
||||||
var fscale = 1.2f;
|
var fscale = 1.2f;
|
||||||
var width = Math.Abs((endposX - posX));
|
var width = Math.Abs((endposX - posX));
|
||||||
var height = Math.Abs((posY - endposY));
|
var height = Math.Abs((posY - endposY));
|
||||||
var tilesWidth = width / (double)_state.TileSize;
|
var tilesWidth = width / (double)_state.TileSize;
|
||||||
var tilesHeight = height / (double)_state.TileSize;
|
var tilesHeight = height / (double)_state.TileSize;
|
||||||
tilesWidth = Math.Round(tilesWidth * 2, MidpointRounding.AwayFromZero) / 2;
|
tilesWidth = Math.Round(tilesWidth * 2, MidpointRounding.AwayFromZero) / 2;
|
||||||
tilesHeight = Math.Round(tilesHeight * 2, MidpointRounding.AwayFromZero) / 2;
|
tilesHeight = Math.Round(tilesHeight * 2, MidpointRounding.AwayFromZero) / 2;
|
||||||
var xmeasure = ffont.MeasureString($"{tilesWidth}");
|
var xmeasure = ffont.MeasureString($"{tilesWidth}");
|
||||||
var ymeasure = ffont.MeasureString($"{tilesHeight}");
|
var ymeasure = ffont.MeasureString($"{tilesHeight}");
|
||||||
float widthX = 0, widthY = 0, heightX = 0, heightY = 0;
|
float widthX = 0, widthY = 0, heightX = 0, heightY = 0;
|
||||||
|
|
||||||
Rectangle area = new Rectangle();
|
Rectangle area = new Rectangle();
|
||||||
if (posX != endposX && posY != endposY)
|
if (posX != endposX && posY != endposY)
|
||||||
{
|
{
|
||||||
|
@ -829,7 +829,7 @@ namespace Sledgemapper
|
||||||
widthY = posY - ymeasure.Y * 1.2f;
|
widthY = posY - ymeasure.Y * 1.2f;
|
||||||
|
|
||||||
heightX = endposX + xmeasure.X / 2;
|
heightX = endposX + xmeasure.X / 2;
|
||||||
heightY = posY + (height/ 2) - ymeasure.Y / 2;
|
heightY = posY + (height / 2) - ymeasure.Y / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -873,16 +873,16 @@ namespace Sledgemapper
|
||||||
0);
|
0);
|
||||||
|
|
||||||
_spriteBatch.DrawString(ffont,
|
_spriteBatch.DrawString(ffont,
|
||||||
$"{tilesHeight}",
|
$"{tilesHeight}",
|
||||||
new Vector2(
|
new Vector2(
|
||||||
heightX, heightY
|
heightX, heightY
|
||||||
),
|
),
|
||||||
Color.Red,
|
Color.Red,
|
||||||
0,
|
0,
|
||||||
Vector2.Zero,
|
Vector2.Zero,
|
||||||
fscale,
|
fscale,
|
||||||
SpriteEffects.None,
|
SpriteEffects.None,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue