Changeset View
Changeset View
Standalone View
Standalone View
plugins/tools/basictools/kis_tool_multihand.cpp
Show First 20 Lines • Show All 178 Lines • ▼ Show 20 Line(s) | 172 | if ((m_handsCount > 1 && m_transformMode == SYMMETRY) || | |||
---|---|---|---|---|---|
179 | // draw lines radiating from the origin | 179 | // draw lines radiating from the origin | ||
180 | for( int i=0; i < m_handsCount; i++) { | 180 | for( int i=0; i < m_handsCount; i++) { | ||
181 | 181 | | |||
182 | currentAngle = i*axesAngle; | 182 | currentAngle = i*axesAngle; | ||
183 | 183 | | |||
184 | // convert angles to radians since cos and sin need that | 184 | // convert angles to radians since cos and sin need that | ||
185 | currentAngle = currentAngle * 0.017453 + m_angle; // m_angle is current rotation set on UI | 185 | currentAngle = currentAngle * 0.017453 + m_angle; // m_angle is current rotation set on UI | ||
186 | 186 | | |||
187 | QPoint startingSpot = QPoint(m_axesPoint.x()+ (cos(currentAngle)*startingInsetLength), m_axesPoint.y()+ (sin(currentAngle))*startingInsetLength ); | 187 | QPoint startingSpot = QPoint(m_axesPoint.x()+ (sin(currentAngle)*startingInsetLength), m_axesPoint.y()- (cos(currentAngle))*startingInsetLength ); | ||
188 | path.moveTo(startingSpot.x(), startingSpot.y()); | 188 | path.moveTo(startingSpot.x(), startingSpot.y()); | ||
189 | QPointF symmetryLinePoint(m_axesPoint.x()+ (cos(currentAngle)*axisLength), m_axesPoint.y()+ (sin(currentAngle))*axisLength ); | 189 | QPointF symmetryLinePoint(m_axesPoint.x()+ (sin(currentAngle)*axisLength), m_axesPoint.y()- (cos(currentAngle))*axisLength ); | ||
190 | path.lineTo(symmetryLinePoint); | 190 | path.lineTo(symmetryLinePoint); | ||
191 | } | 191 | } | ||
192 | 192 | | |||
193 | } | 193 | } | ||
194 | else if(m_transformMode == MIRROR) { | 194 | else if(m_transformMode == MIRROR) { | ||
195 | 195 | | |||
196 | if (m_mirrorHorizontally) { | 196 | if (m_mirrorHorizontally) { | ||
197 | path.moveTo(m_axesPoint.x()-axisLength*cos(m_angle+M_PI_2), m_axesPoint.y()-axisLength*sin(m_angle+M_PI_2)); | 197 | path.moveTo(m_axesPoint.x()-axisLength*cos(m_angle+M_PI_2), m_axesPoint.y()-axisLength*sin(m_angle+M_PI_2)); | ||
▲ Show 20 Lines • Show All 402 Lines • Show Last 20 Lines |