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
diff options
context:
space:
mode:
authormarkusbeth <markus.beth@web.de>2018-10-19 13:58:02 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2018-10-19 13:58:02 +0300
commit665a308c39763aa4af900acd7a13cd65e315c014 (patch)
tree7b84713fb0f79794646a93f66a875f52af4e64dc
parent5ed4143b4f460d0a7a7d4ab745297bd9ab3c0cc9 (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.cs7
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);