Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorKarl <5079870+PreferLinux@users.noreply.github.com>2020-01-13 19:12:36 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2020-01-13 19:12:36 +0300
commit4ee4d368c649e024b516cb26245d9bdd14baa1df (patch)
tree5595251c8c37faf09005ea819997840df2bf01f3 /mcs
parent42956f554bf18dbfbc5f30e4d74f1c54df15f0b4 (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')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms.Theming/Default/LabelPainter.cs2
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),