internal override void Draw(UpdateParameter updateParameter)
{
if (base.Container != null)
{
Rectangle2D bounds = ViewBounds;
double num = 20.0 * Resolution;
Rectangle2D biggerBounds = bounds.Inflate(num, num);//上下左右扩张20个像素的距离
foreach (UIElement element in this.Children)
{
if (element == null)
{
return;
}
if (!(element.GetValue(BBoxProperty) is Rectangle2D))
{
throw new ArgumentException(ExceptionStrings.BboxIsNotSet);
}
Rectangle2D rect = GetBBox(element);
if (rect.IntersectsWith(biggerBounds) && !base.Container.Children.Contains(element))
{
if (element is ShapeElement)
{
ShapeElement sb = element as ShapeElement;
sb.SetPath();
sb.InvalidatePath(base.Container.Resolution, base.Container.OriginX, base.Container.OriginY);
ElementsLayer.SetBBox(sb, sb.ClippedBounds);
}
base.Container.Children.Add(element);
}
}
}
}