src/editmodes/rectangleMode.cpp

changeset 1077
952d6b3e7d11
parent 1072
9ce9496427f2
child 1079
67c6e5d32e68
equal deleted inserted replaced
1076:55cfa9e42d70 1077:952d6b3e7d11
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

mercurial