Skip to content

Commit 0429c05

Browse files
committed
Improvements in image size measurements
- Fixed SVGImage to avoid zero image size in MeasureOverride. Issue #40
1 parent 5d71531 commit 0429c05

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Source/SVGImage/SVG/SVGImage.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,13 @@ protected override Size MeasureOverride(Size constraint)
458458
if (constraint.Height > 0 && constraint.Height < result.Height)
459459
result.Height = constraint.Height;
460460

461+
// Check for empty size...
462+
if (result.IsEmpty)
463+
{
464+
if (this.m_drawing != null && !this.m_drawing.Bounds.Size.IsEmpty)
465+
result = this.m_drawing.Bounds.Size;
466+
}
467+
461468
return result;
462469
}
463470

0 commit comments

Comments
 (0)