public override void DoBeforeDraw(Graphics g) { GetDrawObject(); float x1 = Owner.Layout.CenterX; float y1 = Owner.Layout.CenterY; float x2 = Target.X; float y2 = Target.Y; int drawWidth = Owner.Layout.Rectangle.Width; int drawHeight = Owner.Layout.Rectangle.Height; float drawX = Owner.Layout.Rectangle.Left + (x1 - x2) * OffsetRatioX; float drawY = Owner.Layout.Rectangle.Top + (y1 - y2) * OffsetRatioY; if (ScaleX != 1) { drawWidth = (int)(drawWidth * ScaleX + 0.5F); drawX += (Owner.Layout.RectWidth - drawWidth) / 2; } if (ScaleY != 1) { drawHeight = (int)(drawHeight * ScaleY + 0.5F); drawY += (Owner.Layout.RectHeight - drawHeight) / 2; } Rectangle drawRect = new Rectangle((int)drawX, (int)drawY, drawWidth, drawHeight); _DrawObject.Colors.Opacity = _BaseDrawObject.Colors.Opacity * Opacity; _DrawObject.Angle = _BaseDrawObject.Angle; _DrawObject.Draw(g, drawRect); base.DoBeforeDraw(g); }