summaryrefslogtreecommitdiff
path: root/BitmapChar.cs
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-06-12 01:16:15 +0000
committerIan C <ianc@noddybox.co.uk>2005-06-12 01:16:15 +0000
commitb8b5e5a5cc836a381b4861bc9fc18eb0b72cf0c9 (patch)
tree14dfb63a86842c18f089a89b19f6a368bcf822b4 /BitmapChar.cs
parent9a66f9371393fc793f8427749e167400dff99bb5 (diff)
Added controls for setting characters to top left and setting widths and heights accordingly.
Diffstat (limited to 'BitmapChar.cs')
-rw-r--r--BitmapChar.cs52
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);