Removed duplicate code from PanelPainter.cs