diff options
author | Karl <5079870+PreferLinux@users.noreply.github.com> | 2020-01-13 19:12:36 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2020-01-13 19:12:36 +0300 |
commit | 4ee4d368c649e024b516cb26245d9bdd14baa1df (patch) | |
tree | 5595251c8c37faf09005ea819997840df2bf01f3 /mcs/class/System.Windows.Forms | |
parent | 42956f554bf18dbfbc5f30e4d74f1c54df15f0b4 (diff) |
[Winforms] Always draw at least one line of a Label. (#18422)
Previously, if the Label wasn't quite high enough nothing would be drawn as the line didn't quite fit. It should draw the line anyway, clipped if necessary.
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms.Theming/Default/LabelPainter.cs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms.Theming/Default/LabelPainter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms.Theming/Default/LabelPainter.cs index 221a09c2600..ca35cf6e979 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms.Theming/Default/LabelPainter.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms.Theming/Default/LabelPainter.cs @@ -40,6 +40,8 @@ namespace System.Windows.Forms.Theming.Default label.DrawImage (dc, label.Image, rect, label.ImageAlign); + rect.Height = Math.Max(rect.Height, label.Font.Height); + if (label.Enabled) { dc.DrawString (label.Text, label.Font, ThemeEngine.Current.ResPool.GetSolidBrush (label.ForeColor), |