Skip to content

Commit c5f2868

Browse files
committed
Fix small warning
1 parent 5e54416 commit c5f2868

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Globalization;
3+
using System.Windows;
34
using System.Windows.Controls;
45
using System.Windows.Data;
56
using System.Windows.Media;
@@ -43,8 +44,16 @@ values[2] is not string queryText ||
4344

4445
// Check if Text will be larger than our QueryTextBox
4546
Typeface typeface = new Typeface(queryTextBox.FontFamily, queryTextBox.FontStyle, queryTextBox.FontWeight, queryTextBox.FontStretch);
46-
// TODO: Obsolete warning?
47-
var ft = new FormattedText(queryTextBox.Text, CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, queryTextBox.FontSize, Brushes.Black);
47+
var dpi = VisualTreeHelper.GetDpi(queryTextBox);
48+
var ft = new FormattedText(
49+
queryTextBox.Text,
50+
CultureInfo.CurrentCulture,
51+
FlowDirection.LeftToRight,
52+
typeface,
53+
queryTextBox.FontSize,
54+
Brushes.Black,
55+
dpi.PixelsPerDip
56+
);
4857

4958
var offset = queryTextBox.Padding.Right;
5059

0 commit comments

Comments
 (0)