protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
GraphicsContainer gc;
Matrix mtx;
g.PageUnit = GraphicsUnit.Pixel;
Point scrollPoint = this.AutoScrollPosition;
g.TranslateTransform(scrollPoint.X, scrollPoint.Y);
//Zoom
mtx = g.Transform;
gc = g.BeginContainer();
g.SmoothingMode = document.SmoothingMode;
g.PixelOffsetMode = document.PixelOffsetMode;
g.CompositingQuality = document.CompositingQuality;
g.ScaleTransform(document.Zoom, document.Zoom);
Rectangle clipRectangle = Gsc2Goc(e.ClipRectangle);
document.DrawElements(g, clipRectangle);
if (!((resizeAction != null) && (resizeAction.IsResizing)))
{
document.DrawSelections(g, e.ClipRectangle);
}
if ((isMultiSelection) || (isAddSelection))
{
DrawSelectionRectangle(g);
}
if (isAddLink)
{
linkLine.CalcLink();
linkLine.Draw(g);
}
if ((resizeAction != null) && (!((moveAction != null) && (moveAction.IsMoving))))
{
resizeAction.DrawResizeCorner(g);
}
if (mousePointerElement != null)
{
if (mousePointerElement is IControllable)
{
IController ctrl = ((IControllable)mousePointerElement).GetController();
ctrl.DrawSelection(g);
}
}
g.EndContainer(gc);
g.Transform = mtx;
base.OnPaint(e);
}