Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

using System.Collections;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media.Converters;
using System.Windows.Media.Composition;
using System.Windows.Media.TextFormatting;
Expand Down Expand Up @@ -1226,9 +1227,9 @@ public Rect ComputeInkBoundingBox()

if ((_flags & GlyphRunFlags.CacheInkBounds) != 0)
{
if (_inkBoundingBox != null)
if (_inkBoundingBox is not null)
{
return (Rect)_inkBoundingBox;
return _inkBoundingBox.Value;
}
}

Expand Down Expand Up @@ -1401,7 +1402,7 @@ public Rect ComputeInkBoundingBox()

if ((_flags & GlyphRunFlags.CacheInkBounds) != 0)
{
_inkBoundingBox = bounds;
_inkBoundingBox = new StrongBox<Rect>(bounds);
}

return bounds;
Expand Down Expand Up @@ -2463,7 +2464,7 @@ private enum GlyphRunFlags : byte
private IList<bool> _caretStops;
private XmlLanguage _language;
private string _deviceFontName;
private object _inkBoundingBox; // Used when CacheInkBounds is on
private StrongBox<Rect> _inkBoundingBox; // Used when CacheInkBounds is on
private TextFormattingMode _textFormattingMode;
private float _pixelsPerDip = MS.Internal.FontCache.Util.PixelsPerDip;

Expand Down