src/editmodes/linePathMode.cpp

changeset 1065
c8ecddbd99e9
parent 1063
1f15c52c11f6
child 1072
9ce9496427f2
equal deleted inserted replaced
1064:4c7a353cf583 1065:c8ecddbd99e9
33 for (Vertex const& vrt : points3d) 33 for (Vertex const& vrt : points3d)
34 points << renderer()->convert3dTo2d (vrt); 34 points << renderer()->convert3dTo2d (vrt);
35 35
36 painter.setPen (renderer()->textPen()); 36 painter.setPen (renderer()->textPen());
37 37
38 if (length(points) == length(points3d)) 38 if (countof(points) == countof(points3d))
39 { 39 {
40 for (int i = 0; i < length(points) - 1; ++i) 40 for (int i = 0; i < countof(points) - 1; ++i)
41 { 41 {
42 painter.drawLine (QLineF (points[i], points[i + 1])); 42 painter.drawLine (QLineF (points[i], points[i + 1]));
43 drawLineLength (painter, points3d[i], points3d[i + 1], points[i], points[i + 1]); 43 drawLineLength (painter, points3d[i], points3d[i + 1], points[i], points[i + 1]);
44 } 44 }
45 45
46 for (int i = 0; i < length(points); ++i) 46 for (int i = 0; i < countof(points); ++i)
47 { 47 {
48 const QPointF& point = points[i]; 48 const QPointF& point = points[i];
49 renderer()->drawPoint (painter, point); 49 renderer()->drawPoint (painter, point);
50 renderer()->drawBlipCoordinates (painter, points3d[i], point); 50 renderer()->drawBlipCoordinates (painter, points3d[i], point);
51 } 51 }
80 80
81 void LinePathMode::endDraw() 81 void LinePathMode::endDraw()
82 { 82 {
83 LDObjectList objs; 83 LDObjectList objs;
84 84
85 for (int i = 0; i < length(m_drawedVerts) - 1; ++i) 85 for (int i = 0; i < countof(m_drawedVerts) - 1; ++i)
86 { 86 {
87 LDLine* line = LDSpawn<LDLine>(); 87 LDLine* line = LDSpawn<LDLine>();
88 line->setVertex (0, m_drawedVerts[i]); 88 line->setVertex (0, m_drawedVerts[i]);
89 line->setVertex (1, m_drawedVerts[i + 1]); 89 line->setVertex (1, m_drawedVerts[i + 1]);
90 objs << line; 90 objs << line;

mercurial