private void ArrangeFeature(FeatureElement elm, Rectangle2D clipBox)
{
if (elm.Visibility != Visibility.Collapsed)
{
Rectangle2D b = GetBounds(elm);
if (!b.IsEmpty)
{
double x = (b.Left - this.Origin.X) / this.Resolution;
double y = (this.Origin.Y - b.Top) / this.Resolution;
if (((b.Width > 0.0) || (b.Height > 0.0)) && (elm.PathGeometry != null))
{
double ratio = elm.Resolution / this.Resolution;
this.SetClip(elm, clipBox);
if (elm.ClippedGeometry != null)
{
b = elm.ClippedGeometry.Bounds;
if (b.IsEmpty)
{
return;
}
x = (b.Left - this.Origin.X) / this.Resolution;
y = (this.Origin.Y - b.Top) / this.Resolution;
}
if (elm.PathGeometry.Transform is ScaleTransform)
{
(elm.PathGeometry.Transform as ScaleTransform).ScaleX = (elm.PathGeometry.Transform as ScaleTransform).ScaleY = ratio;
}
else
{
elm.PathGeometry.Transform = new ScaleTransform { ScaleX = ratio, ScaleY = ratio };
}
double num4 = ((b.Width / elm.Resolution) * ratio) + 10.0;
double num5 = ((b.Height / elm.Resolution) * ratio) + 10.0;//这也已经加了10.0
num4 = Math.Min(32000.0, num4);
num5 = Math.Min(32000.0, num5);
elm.Arrange(new Rect(x, y, num4, num5));
}
else
{
elm.Arrange(new Rect(new Point(x, y), elm.DesiredSize));
}
}
}
}