summaryrefslogtreecommitdiff
path: root/MainForm.cs
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-05-21 02:54:04 +0000
committerIan C <ianc@noddybox.co.uk>2005-05-21 02:54:04 +0000
commit326ebe083338e53e261a513418a418413a63bd2f (patch)
treec3332f3a114c66e1d7f021e6537319b4356f24a4 /MainForm.cs
parent600287f275063dde1ea6f55fd9aa5247d27256cf (diff)
Improved font import slightly. Fixed non-clearing of changed flags when saving.
Diffstat (limited to 'MainForm.cs')
-rw-r--r--MainForm.cs19
1 files changed, 13 insertions, 6 deletions
diff --git a/MainForm.cs b/MainForm.cs
index fa13599..00d7514 100644
--- a/MainForm.cs
+++ b/MainForm.cs
@@ -939,7 +939,7 @@ namespace BitmapFontEd
}
}
- private void GrabChar(Bitmap bmp, BitmapChar c)
+ private void GrabChar(Bitmap bmp, BitmapChar c, ref int max_height)
{
int x,y;
int mx,my;
@@ -960,10 +960,10 @@ namespace BitmapFontEd
if (mx==Int32.MinValue)
return;
- System.Diagnostics.Debug.WriteLine("(pre)mx="+mx+" my="+my);
- mx=Math.Min(mx+1,GfxEditor.MAX_SIZE);
- my=Math.Min(my+1,GfxEditor.MAX_SIZE);
- System.Diagnostics.Debug.WriteLine("(post)mx="+mx+" my="+my);
+ mx=Math.Min(mx+2,GfxEditor.MAX_SIZE);
+ my=Math.Min(my+2,GfxEditor.MAX_SIZE);
+
+ max_height=Math.Max(max_height,my);
c.Resize(mx,my);
@@ -986,6 +986,8 @@ namespace BitmapFontEd
{
try
{
+ int max_height=Int32.MinValue;
+
Bitmap bmp=new Bitmap(GfxEditor.MAX_SIZE,
GfxEditor.MAX_SIZE,
PixelFormat.Format32bppArgb);
@@ -1000,10 +1002,15 @@ namespace BitmapFontEd
g.Clear(Color.Transparent);
g.DrawString(s,fdlg.Font,b,0,0);
g.Flush(FlushIntention.Sync);
- GrabChar(bmp,m_chars[ascii-32]);
+ GrabChar(bmp,m_chars[ascii-32],ref max_height);
}
}
+ foreach (BitmapChar c in m_chars)
+ {
+ c.Resize(c.Width,max_height);
+ }
+
m_edit.BitmapChar=new BitmapChar(m_chars[m_selected]);
}
catch (Exception ex)