added support for drawing curved elements.