v1.2.8.0 (Winter Update hotfix 2)
This commit is contained in:
@@ -1421,10 +1421,27 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
Sprite sprite = structure.Sprite;
|
||||
if (sprite is null) { return; }
|
||||
|
||||
Vector2 textureOffset = structure.TextureOffset;
|
||||
textureOffset = new Vector2(
|
||||
MathUtils.PositiveModulo(-textureOffset.X, sprite.SourceRect.Width * structure.TextureScale.X * structure.Scale),
|
||||
MathUtils.PositiveModulo(-textureOffset.Y, sprite.SourceRect.Height * structure.TextureScale.Y * structure.Scale));
|
||||
|
||||
RectangleF entityRect = ScaleRectToUI(structure, parent, border);
|
||||
Vector2 spriteScale = new Vector2(entityRect.Size.X / sprite.size.X, entityRect.Size.Y / sprite.size.Y);
|
||||
sprite.Draw(spriteBatch, new Vector2(entityRect.Location.X + inflate, entityRect.Location.Y + inflate), structure.SpriteColor, Vector2.Zero, 0f, spriteScale, sprite.effects ^ structure.SpriteEffects);
|
||||
Vector2 spriteScale = new Vector2(entityRect.Size.X / structure.Rect.Width, entityRect.Size.Y / structure.Rect.Height);
|
||||
float rotation = MathHelper.ToRadians(structure.Rotation);
|
||||
|
||||
sprite.DrawTiled(
|
||||
spriteBatch: spriteBatch,
|
||||
position: entityRect.Location + entityRect.Size * 0.5f + (inflate, inflate),
|
||||
targetSize: entityRect.Size,
|
||||
rotation: rotation,
|
||||
origin: entityRect.Size * 0.5f,
|
||||
color: structure.SpriteColor,
|
||||
startOffset: textureOffset * spriteScale,
|
||||
textureScale: structure.TextureScale * structure.Scale * spriteScale,
|
||||
depth: structure.SpriteDepth,
|
||||
spriteEffects: sprite.effects ^ structure.SpriteEffects);
|
||||
}
|
||||
|
||||
private static RectangleF ScaleRectToUI(MapEntity entity, RectangleF parentRect, RectangleF worldBorders)
|
||||
|
||||
Reference in New Issue
Block a user