optimize rectangle drawing with round corners and without round corners