public virtual void AdjustAreasPosition(MapGraphics graph, ref RectangleF areasRect) { SizeF size = new SizeF(sizeLeftTop); SizeF size2 = new SizeF(sizeRightBottom); size.Width += defaultRadiusSize * 0.7f; size.Height += defaultRadiusSize * 0.85f; size2.Width += defaultRadiusSize * 0.7f; size2.Height += defaultRadiusSize * 0.7f; size = graph.GetRelativeSize(size); size2 = graph.GetRelativeSize(size2); if (size.Width > 30f) { size.Width = 0f; } if (size.Height > 30f) { size.Height = 0f; } if (size2.Width > 30f) { size2.Width = 0f; } if (size2.Height > 30f) { size2.Height = 0f; } areasRect.X += size.Width; areasRect.Width -= Math.Min(areasRect.Width, size.Width + size2.Width); areasRect.Y += size.Height; areasRect.Height -= Math.Min(areasRect.Height, size.Height + size2.Height); if (areasRect.Right > 100f) { if (areasRect.Width > 100f - areasRect.Right) { areasRect.Width -= 100f - areasRect.Right; } else { areasRect.X -= 100f - areasRect.Right; } } if (areasRect.Bottom > 100f) { if (areasRect.Height > 100f - areasRect.Bottom) { areasRect.Height -= 100f - areasRect.Bottom; } else { areasRect.Y -= 100f - areasRect.Bottom; } } }
public virtual void AdjustAreasPosition(MapGraphics graph, ref RectangleF areasRect) { SizeF size = new SizeF(this.sizeLeftTop); SizeF size2 = new SizeF(this.sizeRightBottom); size.Width += (float)(this.defaultRadiusSize * 0.699999988079071); size.Height += (float)(this.defaultRadiusSize * 0.85000002384185791); size2.Width += (float)(this.defaultRadiusSize * 0.699999988079071); size2.Height += (float)(this.defaultRadiusSize * 0.699999988079071); size = graph.GetRelativeSize(size); size2 = graph.GetRelativeSize(size2); if (size.Width > 30.0) { size.Width = 0f; } if (size.Height > 30.0) { size.Height = 0f; } if (size2.Width > 30.0) { size2.Width = 0f; } if (size2.Height > 30.0) { size2.Height = 0f; } areasRect.X += size.Width; areasRect.Width -= Math.Min(areasRect.Width, size.Width + size2.Width); areasRect.Y += size.Height; areasRect.Height -= Math.Min(areasRect.Height, size.Height + size2.Height); if (areasRect.Right > 100.0) { if (areasRect.Width > 100.0 - areasRect.Right) { areasRect.Width -= (float)(100.0 - areasRect.Right); } else { areasRect.X -= (float)(100.0 - areasRect.Right); } } if (areasRect.Bottom > 100.0) { if (areasRect.Height > 100.0 - areasRect.Bottom) { areasRect.Height -= (float)(100.0 - areasRect.Bottom); } else { areasRect.Y -= (float)(100.0 - areasRect.Bottom); } } }
public virtual RectangleF GetBoundRect(MapGraphics g) { RectangleF result = default(RectangleF); if (LocationUnit == CoordinateUnit.Percent) { result.Location = Location; } else { result.Location = g.GetRelativePoint(Location); } if (SizeUnit == CoordinateUnit.Percent) { result.Size = Size; } else { result.Size = g.GetRelativeSize(Size); } return(result); }
public virtual void AdjustAreasPosition(MapGraphics graph, ref RectangleF areasRect) { SizeF size = new SizeF(7.5f, 7.5f); size = graph.GetRelativeSize(size); if (size.Width < 30f) { areasRect.X += size.Width; areasRect.Width -= Math.Min(areasRect.Width, size.Width * 2.5f); } if (size.Height < 30f) { areasRect.Y += size.Height; areasRect.Height -= Math.Min(areasRect.Height, size.Height * 2.5f); } if (areasRect.X + areasRect.Width > 100f) { areasRect.X -= 100f - areasRect.Width; } if (areasRect.Y + areasRect.Height > 100f) { areasRect.Y -= 100f - areasRect.Height; } }