src/editmodes/circleMode.cpp

changeset 1082
1738bdaf36d6
parent 1079
67c6e5d32e68
child 1088
c6d242d2b619
equal deleted inserted replaced
1081:47cde4087cc5 1082:1738bdaf36d6
123 123
124 for (const RingFinder::Component& component : g_RingFinder.bestSolution()->getComponents()) 124 for (const RingFinder::Component& component : g_RingFinder.bestSolution()->getComponents())
125 { 125 {
126 primitiveModel.ringNumber = component.num; 126 primitiveModel.ringNumber = component.num;
127 primitiveFile = primitives()->getPrimitive(primitiveModel); 127 primitiveFile = primitives()->getPrimitive(primitiveModel);
128 LDSubfileReference* ref = model.emplace<LDSubfileReference>(); 128 model.emplace<LDSubfileReference>(primitiveFile, getCircleDrawMatrix(component.scale), m_drawedVerts.first());
129 ref->setFileInfo(primitiveFile);
130 ref->setTransformationMatrix(getCircleDrawMatrix(component.scale));
131 ref->setPosition(m_drawedVerts[0]);
132 } 129 }
133 } 130 }
134 else 131 else
135 { 132 {
136 // Ring finder failed, last resort: draw the ring with quads 133 // Ring finder failed, last resort: draw the ring with quads
170 quad->invert(); 167 quad->invert();
171 } 168 }
172 } 169 }
173 170
174 if (circleOrDisc and primitiveFile) 171 if (circleOrDisc and primitiveFile)
175 { 172 model.emplace<LDSubfileReference>(primitiveFile, transform, m_drawedVerts.first());
176 LDSubfileReference* ref = model.emplace<LDSubfileReference>();
177 ref->setFileInfo (primitiveFile);
178 ref->setTransformationMatrix (transform);
179 ref->setPosition (m_drawedVerts[0]);
180 ref->setColor (MainColor);
181 }
182 173
183 if (not model.isEmpty()) 174 if (not model.isEmpty())
184 { 175 {
185 Axis relZ = renderer()->getRelativeZ();; 176 Axis relZ = renderer()->getRelativeZ();;
186 int l = (relZ == X ? 1 : 0); 177 int l = (relZ == X ? 1 : 0);

mercurial