Fix software cursor rendering at fractional scales.

This commit is contained in:
Paul Chote
2020-01-26 16:39:39 +00:00
committed by abcdefg30
parent 25a7299c67
commit bd4724842c
2 changed files with 14 additions and 3 deletions

View File

@@ -36,7 +36,12 @@ namespace OpenRA.Mods.Common.Widgets
if (sprite != null && palette != null)
{
var directionPalette = worldRenderer.Palette(palette);
WidgetUtils.DrawSHPCentered(sprite, ChildOrigin, directionPalette, graphicSettings.CursorDouble ? 2 : 1);
// Cursor is rendered in native window coordinates
// Apply same scaling rules as hardware cursors
var ws = Game.Renderer.WindowScale;
var scale = (graphicSettings.CursorDouble ? 2 : 1) * (ws > 1.5f ? 2 : 1);
WidgetUtils.DrawSHPCentered(sprite, ChildOrigin, directionPalette, scale / ws);
}
}