#include #include "poly.h" void Polygon::draw(Drawable &d) { // No points. Nothing to draw. if(npts == 0) return; // One point. Just set it. if(npts == 1) { d.set(origx, origy); return; } // Multiple points. Work to do. Point first(origx, origy); Point prev = first; for(int n = 0; n < npts - 1; ++n) { d.line(prev.x(), prev.y(), } }