diff options
author | Ivan Zlatev <ivan@ivanz.com> | 2008-06-03 15:04:33 +0400 |
---|---|---|
committer | Ivan Zlatev <ivan@ivanz.com> | 2008-06-03 15:04:33 +0400 |
commit | a0b5bd66266b689af0851c348d6efc2a7167d933 (patch) | |
tree | 3f364e1744a91fa20c3b4a93819053dc5c0d3bdb /mcs/class/System.Drawing.Design | |
parent | 6135152def665eedfdcbcb0b4a91484121caa1d8 (diff) |
2008-06-03 Ivan N. Zlatev <contact@i-nz.net>
* FontNameEditor.cs: PaintEventArgs.Value is string containing
the font name and not a Font.
Based on a patch by Andy Hume <andyhume32@yahoo.co.uk>
[Fixes bug #396631]
svn path=/trunk/mcs/; revision=104740
Diffstat (limited to 'mcs/class/System.Drawing.Design')
-rw-r--r-- | mcs/class/System.Drawing.Design/System.Drawing.Design/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/System.Drawing.Design/System.Drawing.Design/FontNameEditor.cs | 9 |
2 files changed, 12 insertions, 4 deletions
diff --git a/mcs/class/System.Drawing.Design/System.Drawing.Design/ChangeLog b/mcs/class/System.Drawing.Design/System.Drawing.Design/ChangeLog index 6d47a30bc65..98b6e0e34fa 100644 --- a/mcs/class/System.Drawing.Design/System.Drawing.Design/ChangeLog +++ b/mcs/class/System.Drawing.Design/System.Drawing.Design/ChangeLog @@ -1,3 +1,10 @@ +2008-06-03 Ivan N. Zlatev <contact@i-nz.net> + + * FontNameEditor.cs: PaintEventArgs.Value is string containing + the font name and not a Font. + Based on a patch by Andy Hume <andyhume32@yahoo.co.uk> + [Fixes bug #396631] + 2008-04-01 Ivan N. Zlatev <contact@i-nz.net> * ColorEditor.cs: Cache the editor contorl instead of creating diff --git a/mcs/class/System.Drawing.Design/System.Drawing.Design/FontNameEditor.cs b/mcs/class/System.Drawing.Design/System.Drawing.Design/FontNameEditor.cs index db929746996..09ee3ece62c 100644 --- a/mcs/class/System.Drawing.Design/System.Drawing.Design/FontNameEditor.cs +++ b/mcs/class/System.Drawing.Design/System.Drawing.Design/FontNameEditor.cs @@ -57,10 +57,11 @@ namespace System.Drawing.Design G.FillRectangle (SystemBrushes.ActiveCaption, e.Bounds); // Draw the sample string - if (e.Value != null) - { - Font F = (Font) e.Value; - G.DrawString (PreviewString, F, SystemBrushes.ActiveCaptionText, e.Bounds); + string fontName = e.Value as string; + if (fontName != null && fontName.Length > 0) { + using (Font font = new Font (fontName, e.Bounds.Height, FontStyle.Regular, GraphicsUnit.Pixel)) { + G.DrawString (PreviewString, font, SystemBrushes.ActiveCaptionText, e.Bounds); + } } // Draw the border again to ensure it is not overlapped by the text |