summaryrefslogtreecommitdiff
path: root/MainForm.cs
diff options
context:
space:
mode:
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)