/// <summary> /// Application idle handler gives editing commands the opportunity to re-paint /// any command-specific stuff. /// </summary> internal void OnIdle() { bool repaint = false; ISpatialDisplay display = ActiveDisplay; if (m_Inverse != null) { m_Inverse.Draw(); repaint = true; } if (m_Check != null) { m_Check.Render(display, DrawStyle); repaint = true; } if (m_Sel != null) { m_Sel.Render(display); repaint = true; } if (m_Sel != null || m_HasSelectionChanged) { SpatialSelection.Render(display, HighlightStyle); repaint = true; m_HasSelectionChanged = false; } if (m_Command != null && m_Command.PerformsPainting) { // Restoring the last draw here can cause flickering of the command-specific // stuff, so make it the responsibility of the command to call erase stuff. // (the main thing to ensure is that the call to RestoreLastDraw is made // only when the user has really made some sort of change). // m_Command.ActiveDisplay.RestoreLastDraw(); m_Command.Paint(null); repaint = true; } if (repaint) { display.PaintNow(); } }