protected virtual void ScaleAndDraw(Graphics g, RectangleF displayRect) {
RectangleF bounds = FullBounds;
g.TranslateTransform(displayRect.X, displayRect.Y);
// scale the graphics so node's full bounds fit in the imageable bounds.
float scale = displayRect.Width / bounds.Width;
if (displayRect.Height / bounds.Height < scale) {
scale = displayRect.Height / bounds.Height;
}
g.ScaleTransform(scale, scale);
g.TranslateTransform(-bounds.X, -bounds.Y);
PPaintContext pc = new PPaintContext(g, null);
pc.RenderQuality = RenderQuality.HighQuality;
FullPaint(pc);
}
#endregion