mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
Add MaxWidth property for text rendering in UI controls and fix maxWidth parameter in canvas extension methods
This commit is contained in:
@@ -70,10 +70,11 @@ public static class CanvasExtensions
|
||||
byte height = font.Height;
|
||||
|
||||
int targetWidth = width * targetHeight / height;
|
||||
int endX = maxWidth == int.MaxValue ? int.MaxValue : x + maxWidth;
|
||||
|
||||
for (int i = 0; i < str.Length; i++)
|
||||
{
|
||||
if (x + targetWidth > maxWidth)
|
||||
if (x + targetWidth > endX)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user