diff options
author | markusbeth <markus.beth@web.de> | 2018-10-19 13:58:02 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-10-19 13:58:02 +0300 |
commit | 665a308c39763aa4af900acd7a13cd65e315c014 (patch) | |
tree | 7b84713fb0f79794646a93f66a875f52af4e64dc | |
parent | 5ed4143b4f460d0a7a7d4ab745297bd9ab3c0cc9 (diff) |
[WinForms] Propagate the flags from DrawTextInternal to MeasureTextInternal (#11251)
Flags to DrawText never reached MeasureText therefore strings with '&' were measured incorrect when drawn with flag TextFormatFlags.NoPrefix.
Fixes #6352
-rw-r--r-- | mcs/class/System.Windows.Forms/System.Windows.Forms/TextRenderer.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TextRenderer.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TextRenderer.cs index b82629a0483..a4549a75250 100644 --- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TextRenderer.cs +++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/TextRenderer.cs @@ -318,10 +318,15 @@ namespace System.Windows.Forms internal static void DrawTextInternal (IDeviceContext dc, string text, Font font, Point pt, Color foreColor, Color backColor, TextFormatFlags flags, bool useDrawString) { - Size sz = MeasureTextInternal (dc, text, font, useDrawString); + Size sz = MeasureTextInternal (dc, text, font, flags, useDrawString); DrawTextInternal (dc, text, font, new Rectangle (pt, sz), foreColor, backColor, flags, useDrawString); } + internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, TextFormatFlags flags, bool useMeasureString) + { + return MeasureTextInternal (dc, text, font, Size.Empty, flags, useMeasureString); + } + internal static Size MeasureTextInternal (IDeviceContext dc, string text, Font font, bool useMeasureString) { return MeasureTextInternal (dc, text, font, Size.Empty, TextFormatFlags.Default, useMeasureString); |