Skip to content

Commit 38ff535

Browse files
author
ArthurHub
committed
possible fix dor WPF measure issue
1 parent 43caf42 commit 38ff535

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Source/HtmlRenderer.WPF/HtmlLabel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ protected override Size MeasureOverride(Size constraint)
9696
}
9797
}
9898

99+
if (double.IsPositiveInfinity(constraint.Width) || double.IsPositiveInfinity(constraint.Height))
100+
constraint = Size.Empty;
101+
99102
return constraint;
100103
}
101104

Source/HtmlRenderer.WPF/HtmlPanel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ protected override Size MeasureOverride(Size constraint)
142142
if (relayout)
143143
PerformHtmlLayout(constraint);
144144

145+
if (double.IsPositiveInfinity(constraint.Width) || double.IsPositiveInfinity(constraint.Height))
146+
constraint = size;
147+
145148
return constraint;
146149
}
147150

0 commit comments

Comments
 (0)