diff options
Diffstat (limited to 'BitmapChar.cs')
-rw-r--r-- | BitmapChar.cs | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/BitmapChar.cs b/BitmapChar.cs index 649c135..cd1fc00 100644 --- a/BitmapChar.cs +++ b/BitmapChar.cs @@ -71,6 +71,58 @@ namespace BitmapFontEd get {return m_changed;}
}
+ public int FirstUsedRow
+ {
+ get
+ {
+ for(int y=0;y<m_height;y++)
+ for(int x=0;x<m_width;x++)
+ if (m_data[x,y].A!=0)
+ return y;
+
+ return -1;
+ }
+ }
+
+ public int FirstUsedColumn
+ {
+ get
+ {
+ for(int x=0;x<m_width;x++)
+ for(int y=0;y<m_height;y++)
+ if (m_data[x,y].A!=0)
+ return x;
+
+ return -1;
+ }
+ }
+
+ public int LastUsedRow
+ {
+ get
+ {
+ for(int y=m_height-1;y>=0;y--)
+ for(int x=0;x<m_width;x++)
+ if (m_data[x,y].A!=0)
+ return y;
+
+ return -1;
+ }
+ }
+
+ public int LastUsedColumn
+ {
+ get
+ {
+ for(int x=m_width-1;x>=0;x--)
+ for(int y=0;y<m_height;y++)
+ if (m_data[x,y].A!=0)
+ return x;
+
+ return -1;
+ }
+ }
+
public void Resize(int width, int height)
{
CheckSize(width,height);
|