diff -r 4c7a353cf583 -r c8ecddbd99e9 src/editmodes/curvemode.cpp --- a/src/editmodes/curvemode.cpp Sat Jan 28 14:13:01 2017 +0200 +++ b/src/editmodes/curvemode.cpp Sat Jan 28 14:14:28 2017 +0200 @@ -25,36 +25,36 @@ void CurveMode::render (QPainter& painter) const { - if (length(m_drawedVerts) >= 1) + if (countof(m_drawedVerts) >= 1) { Vertex curve[4]; QPoint curve2d[4]; - for (int i = 0; i < qMin (length(curve), length(m_drawedVerts)); ++i) + for (int i = 0; i < qMin (countof(curve), countof(m_drawedVerts)); ++i) curve[i] = m_drawedVerts[i]; // Factor the cursor into the preview - if (length(m_drawedVerts) < 4) - curve[length(m_drawedVerts)] = getCursorVertex(); + if (countof(m_drawedVerts) < 4) + curve[countof(m_drawedVerts)] = getCursorVertex(); // Default the control points to the first vertex position - if (length(m_drawedVerts) < 2) + if (countof(m_drawedVerts) < 2) curve[2] = curve[0]; - if (length(m_drawedVerts) < 3) + if (countof(m_drawedVerts) < 3) curve[3] = curve[2]; - for (int i = 0; i < length(curve); ++i) + for (int i = 0; i < countof(curve); ++i) curve2d[i] = renderer()->convert3dTo2d (curve[i]); painter.setPen (QColor (0, 112, 112)); - if (length(m_drawedVerts) >= 2) + if (countof(m_drawedVerts) >= 2) painter.drawLine (curve2d[0], curve2d[2]); - if (length(m_drawedVerts) >= 3) + if (countof(m_drawedVerts) >= 3) painter.drawLine (curve2d[1], curve2d[3]); - for (int i = 0; i < qMin (length(curve), length(m_drawedVerts) + 1); ++i) + for (int i = 0; i < qMin (countof(curve), countof(m_drawedVerts) + 1); ++i) { if (i < 2) renderer()->drawPoint (painter, curve2d[i]); @@ -84,7 +84,7 @@ void CurveMode::endDraw() { - if (length(m_drawedVerts) == 4) + if (countof(m_drawedVerts) == 4) { LDObjectList objs; objs << LDSpawn (m_drawedVerts[0], m_drawedVerts[1], m_drawedVerts[2], m_drawedVerts[3]);