diff options
Diffstat (limited to 'src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs')
-rw-r--r-- | src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs new file mode 100644 index 0000000..3bfc123 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Linq; + +namespace System.Windows.Media +{ + public class GeometryGroup : System.Windows.Media.Geometry + { + public List<Geometry> Children { get; } = new List<Geometry>(); + + public override Rect Bounds + { + get + { + if (Children.Count == 0) + return Rect.Empty; + var union = Children[0].Bounds; + foreach (var c in Children.Skip(1)) + union.Union(c.Bounds); + return union; + } + } + public override bool IsEmpty() + { + return !Children.Any(c => !c.IsEmpty()); + } + } +}
\ No newline at end of file |