Rectangle and free drawing functionality.