private void ArrangeShapeBase(ShapeElement sb, Rectangle2D clipBox)
{
if (sb.Visibility != Visibility.Collapsed)
{
Rectangle2D b = GetBounds(sb);
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)) && (sb.Point2Ds != null))
{
double ratio = sb.Resolution / this.Resolution;
this.SetClipShapeBase(sb, clipBox);
if (sb.ClippedPoint2Ds != null)
{
b = sb.ClippedPoint2Ds.GetBounds();
if (b.IsEmpty)
{
return;
}
x = (b.Left - this.Origin.X) / this.Resolution;
y = (this.Origin.Y - b.Top) / this.Resolution;
}
if (sb.EncapsulatedShape.RenderTransform is ScaleTransform)
{
(sb.EncapsulatedShape.RenderTransform as ScaleTransform).ScaleX = (sb.EncapsulatedShape.RenderTransform as ScaleTransform).ScaleY = ratio;
}
else
{
sb.EncapsulatedShape.RenderTransform = new ScaleTransform { ScaleX = ratio, ScaleY = ratio };
}
double num4 = b.Width / sb.Resolution * ratio + 10.0;
double num5 = b.Height / sb.Resolution * ratio + 10.0;
num4 = Math.Min(32000.0, num4);
num5 = Math.Min(32000.0, num5);
sb.Arrange(new Rect(x, y, num4, num5));
}
else
{
sb.Arrange(new Rect(new Point(x, y), sb.DesiredSize));
}
}
}
}