src/editmodes/circleMode.cpp

changeset 1024
67ba0ee049eb
parent 1023
9450ac3cd930
child 1025
4949da3fb4b3
equal deleted inserted replaced
1023:9450ac3cd930 1024:67ba0ee049eb
183 } 183 }
184 184
185 if (not objs.isEmpty()) 185 if (not objs.isEmpty())
186 { 186 {
187 Axis relZ = renderer()->getRelativeZ();; 187 Axis relZ = renderer()->getRelativeZ();;
188 const int l (relZ == X ? 1 : 0); 188 int l = (relZ == X ? 1 : 0);
189 const int m (relZ == Y ? 1 : 0); 189 int m = (relZ == Y ? 1 : 0);
190 const int n (relZ == Z ? 1 : 0); 190 int n = (relZ == Z ? 1 : 0);
191 RotateObjects (l, m, n, -m_angleOffset, objs); 191 math()->rotateObjects (l, m, n, -m_angleOffset, objs);
192 } 192 }
193 193
194 finishDraw (objs); 194 finishDraw (objs);
195 } 195 }
196 196
197 double CircleMode::getAngleOffset() const 197 double CircleMode::getAngleOffset() const
198 { 198 {
199 if (m_drawedVerts.isEmpty()) 199 if (m_drawedVerts.isEmpty())
200 return 0.0; 200 return 0.0;
201 201
202 const int divisions (m_window->ringToolHiRes() ? HighResolution : LowResolution); 202 int divisions = (m_window->ringToolHiRes() ? HighResolution : LowResolution);
203 QPointF originspot (renderer()->convert3dTo2d (m_drawedVerts.first())); 203 QPointF originspot (renderer()->convert3dTo2d (m_drawedVerts.first()));
204 QLineF bearing (originspot, renderer()->mousePositionF()); 204 QLineF bearing (originspot, renderer()->mousePositionF());
205 QLineF bearing2 (originspot, QPointF (originspot.x(), 0.0)); 205 QLineF bearing2 (originspot, QPointF (originspot.x(), 0.0));
206 double angleoffset (-bearing.angleTo (bearing2) + 90); 206 double angleoffset (-bearing.angleTo (bearing2) + 90);
207 angleoffset /= (360.0 / divisions); // convert angle to 0-16 scale 207 angleoffset /= (360.0 / divisions); // convert angle to 0-16 scale

mercurial