Visual Mode: fixed a problem where scaled sprites were shown with the wrong offset

This commit is contained in:
biwa 2023-09-17 17:03:58 +02:00
parent 63010d871a
commit 59197fdfe0

View file

@ -328,8 +328,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Determine sprite size and offset
float radius = sprite.ScaledWidth * 0.5f;
float height = sprite.ScaledHeight;
offsets.x = radius - (sprite.OffsetX == int.MinValue ? 0 : sprite.OffsetX);
offsets.y = (sprite.OffsetY == int.MinValue ? 0 : sprite.OffsetY) - height;
offsets.x = radius - (sprite.OffsetX == int.MinValue ? 0 : sprite.OffsetX) * sprite.Scale.x;
offsets.y = (sprite.OffsetY == int.MinValue ? 0 : sprite.OffsetY) * sprite.Scale.y - height;
// Scale by thing type/actor scale
// We do this after the offset x/y determination above, because that is entirely in sprite pixels space