Round CashTick pos to the nearest int.

This commit is contained in:
Paul Chote
2013-06-24 19:31:15 +12:00
parent fc6a38182d
commit f52a1c1521

View File

@@ -8,6 +8,7 @@
*/ */
#endregion #endregion
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
@@ -43,8 +44,9 @@ namespace OpenRA.Graphics
public void BeforeRender(WorldRenderer wr) {} public void BeforeRender(WorldRenderer wr) {}
public void Render(WorldRenderer wr) public void Render(WorldRenderer wr)
{ {
var screenPos = Game.viewport.Zoom*(wr.ScreenPxPosition(pos) - Game.viewport.Location) - 0.5f*font.Measure(text).ToFloat2(); var screenPos = Game.viewport.Zoom*(wr.ScreenPosition(pos) - Game.viewport.Location) - 0.5f*font.Measure(text).ToFloat2();
font.DrawTextWithContrast(text, screenPos, color, Color.Black, 1); var screenPxPos = new float2((float)Math.Round(screenPos.X), (float)Math.Round(screenPos.Y));
font.DrawTextWithContrast(text, screenPxPos, color, Color.Black, 1);
} }
public void RenderDebugGeometry(WorldRenderer wr) public void RenderDebugGeometry(WorldRenderer wr)