39 |
39 |
40 void RectangleMode::endDraw() |
40 void RectangleMode::endDraw() |
41 { |
41 { |
42 if (countof(m_drawedVerts) == 2) |
42 if (countof(m_drawedVerts) == 2) |
43 { |
43 { |
44 LDQuad* quad = LDSpawn<LDQuad>(); |
44 Model model; |
|
45 LDQuad* quad = model.emplace<LDQuad>(); |
45 updateRectVerts(); |
46 updateRectVerts(); |
46 |
47 |
47 for (int i = 0; i < quad->numVertices(); ++i) |
48 for (int i = 0; i < quad->numVertices(); ++i) |
48 quad->setVertex (i, m_rectangleVerts[i]); |
49 quad->setVertex(i, m_rectangleVerts[i]); |
49 |
50 |
50 quad->setColor (MainColor); |
51 finishDraw(model); |
51 finishDraw (LDObjectList ({quad})); |
|
52 } |
52 } |
53 } |
53 } |
54 |
54 |
55 // |
55 // |
56 // Update rect vertices when the mouse moves since the 3d position likely has changed |
56 // Update rect vertices when the mouse moves since the 3d position likely has changed |