protected ChatMessagePart MouseForwarding(PointF location, MouseEventArgs e, ForwardingDelegate del) { float pX = 0, pY = 0; float lineHeight = 0; foreach (ChatMessagePart part in parts) { if ((pX + part.Size.Width > Size.Width) && lineHeight != 0) { pX = 0; pY += lineHeight; lineHeight = 0; } lineHeight = Math.Max(lineHeight, part.Size.Height); if (new RectangleF(new PointF(pX, pY), part.Size).Contains(location)) { del(part, new PointF(location.X - pX, location.Y - pY), e); return(part); } pX += part.Size.Width; } return(null); }
protected ChatMessagePart MouseForwarding(PointF location, MouseEventArgs e, ForwardingDelegate del) { float pX = 0, pY = 0; float lineHeight = 0; foreach (ChatMessagePart part in parts) { if ((pX + part.Size.Width > Size.Width) && lineHeight != 0) { pX = 0; pY += lineHeight; lineHeight = 0; } lineHeight = Math.Max(lineHeight, part.Size.Height); if (new RectangleF(new PointF(pX, pY), part.Size).Contains(location)) { del(part, new PointF(location.X - pX, location.Y - pY), e); return part; } pX += part.Size.Width; } return null; }