src/gldraw.cpp

changeset 527
47c068f2e7e3
parent 526
b29b6fc45ba9
child 529
c294b2070185
equal deleted inserted replaced
526:b29b6fc45ba9 527:47c068f2e7e3
612 } 612 }
613 } 613 }
614 } 614 }
615 elif (editMode() == CircleMode) 615 elif (editMode() == CircleMode)
616 { // If we have not specified the center point of the circle yet, preview it on the screen. 616 { // If we have not specified the center point of the circle yet, preview it on the screen.
617 if (m_drawedVerts.size() == 0) 617 if (m_drawedVerts.isEmpty())
618 drawBlip (paint, coordconv3_2 (m_hoverpos)); 618 drawBlip (paint, coordconv3_2 (m_hoverpos));
619 else 619 else
620 { QVector<vertex> verts, verts2; 620 { QVector<vertex> verts, verts2;
621 const double dist0 = circleDrawDist(0), 621 const double dist0 = circleDrawDist (0),
622 dist1 = (m_drawedVerts.size() >= 2) ? circleDrawDist (1) : -1; 622 dist1 = (m_drawedVerts.size() >= 2) ? circleDrawDist (1) : -1;
623 const int segs = lores; 623 const int segs = lores;
624 const double angleUnit = (2 * pi) / segs; 624 const double angleUnit = (2 * pi) / segs;
625 Axis relX, relY; 625 Axis relX, relY;
626 QVector<QPoint> ringpoints, circlepoints, circle2points; 626 QVector<QPoint> ringpoints, circlepoints, circle2points;
963 if (m_drawedVerts.size() >= 4) 963 if (m_drawedVerts.size() >= 4)
964 { endDraw (true); 964 { endDraw (true);
965 return; 965 return;
966 } 966 }
967 967
968 if (m_drawedVerts.size() == 0 && ev->modifiers() & Qt::ShiftModifier) 968 if (m_drawedVerts.isEmpty() && ev->modifiers() & Qt::ShiftModifier)
969 { m_rectdraw = true; 969 { m_rectdraw = true;
970 updateRectVerts(); 970 updateRectVerts();
971 } 971 }
972 } 972 }
973 973
1819 // ----------------------------------------------------------------------------- 1819 // -----------------------------------------------------------------------------
1820 void GLRenderer::updateRectVerts() 1820 void GLRenderer::updateRectVerts()
1821 { if (!m_rectdraw) 1821 { if (!m_rectdraw)
1822 return; 1822 return;
1823 1823
1824 if (m_drawedVerts.size() == 0) 1824 if (m_drawedVerts.isEmpty())
1825 { for (int i = 0; i < 4; ++i) 1825 { for (int i = 0; i < 4; ++i)
1826 m_rectverts[i] = m_hoverpos; 1826 m_rectverts[i] = m_hoverpos;
1827 1827
1828 return; 1828 return;
1829 } 1829 }

mercurial