Fix text block display issues

This commit is contained in:
NGnius (Graham) 2020-05-19 22:25:16 -04:00
parent b7cbf4486f
commit 1187d7896c
2 changed files with 2 additions and 2 deletions

View file

@ -167,7 +167,7 @@ namespace Pixi.Images
position.x += 1f;
position.y += (float)blockSize;
string text = PixelUtility.TextureToString(img);
TextBlock textBlock = TextBlock.PlaceNew(position, scale: new float3(Mathf.Ceil(img.width / 16), Mathf.Ceil(img.height / 16), 1));
TextBlock textBlock = TextBlock.PlaceNew(position, scale: new float3(Mathf.Ceil(img.width / 16), 1, Mathf.Ceil(img.height / 16)));
textBlock.Text = text;
byte[] textHash;
using (HashAlgorithm hasher = SHA256.Create())

View file

@ -149,7 +149,7 @@ namespace Pixi.Images
public static string TextureToString(Texture2D img)
{
StringBuilder imgString = new StringBuilder("<cspace=-0.1em><line-height=42%>");
StringBuilder imgString = new StringBuilder("<cspace=-0.13em><line-height=40%>");
for (int y = img.height-1; y >= 0 ; y--) // text origin is top right, but img origin is bottom right
{
for (int x = 0; x < img.width; x++)