void hdPolyLineFigure::basicDraw(wxBufferedDC &context, hdDrawingView *view) { int posIdx = view->getIdx(); if(points[posIdx]->count() < 2) { return; } hdPoint start, end; if(startTerminal) { startTerminal->setLinePen(linePen); start = startTerminal->draw(context, getStartPoint(posIdx), pointAt(posIdx, 1), view); } else { start = getStartPoint(posIdx); } if(endTerminal) { endTerminal->setLinePen(linePen); end = endTerminal->draw(context, getEndPoint(posIdx), pointAt(posIdx, pointCount(posIdx) - 2), view); } else { end = getEndPoint(posIdx); } context.SetPen(linePen); for(int i = 0; i < points[posIdx]->count() - 1; i++) { hdPoint *p1 = (hdPoint *) points[posIdx]->getItemAt(i); hdPoint *p2 = (hdPoint *) points[posIdx]->getItemAt(i + 1); hdPoint copyP1 = hdPoint (*p1); view->CalcScrolledPosition(copyP1.x, copyP1.y, ©P1.x, ©P1.y); hdPoint copyP2 = hdPoint (*p2); view->CalcScrolledPosition(copyP2.x, copyP2.y, ©P2.x, ©P2.y); context.DrawLine(copyP1, copyP2); } }