Fix stock flags being stretched

This commit is contained in:
2020-11-29 16:02:45 -08:00
parent 2793f5fcb1
commit e56278c6cb
6 changed files with 17 additions and 8 deletions

View File

@ -41,7 +41,14 @@ namespace ConformalDecals.MaterialProperties {
public Vector2 Dimensions => new Vector2(_texture.width, _texture.height);
public Vector2 MaskedDimensions => _hasTile ? _tileRect.size : Dimensions;
public float AspectRatio => MaskedHeight / (float) MaskedWidth;
public float AspectRatio {
get {
if (_texture == null) return 1;
if (_textureUrl?.Contains("Squad/Flags") == true) return 0.625f;
if (_hasTile) return MaskedHeight / (float) MaskedWidth;
return _texture.height / _texture.width;
}
}
public override void ParseNode(ConfigNode node) {
base.ParseNode(node);

View File

@ -1,5 +1 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: KSPAssembly("ConformalDecals", 0, 1, 0)]
[assembly: KSPAssembly("ConformalDecals", 0, 2, 6)]