* @brief DopeSheetViewPrivate::drawSelectedKeysBRect * * */
| 1663 | * |
| 1664 | */ |
| 1665 | void |
| 1666 | DopeSheetViewPrivate::drawSelectedKeysBRect() const |
| 1667 | { |
| 1668 | running_in_main_thread_and_context(q_ptr); |
| 1669 | |
| 1670 | // Perform drawing |
| 1671 | { |
| 1672 | GLProtectAttrib a(GL_HINT_BIT | GL_ENABLE_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_LINE_BIT); |
| 1673 | |
| 1674 | glEnable(GL_BLEND); |
| 1675 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
| 1676 | glEnable(GL_LINE_SMOOTH); |
| 1677 | glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE); |
| 1678 | |
| 1679 | // Draw outline |
| 1680 | glColor4f(0.5, 0.5, 0.5, 1.); |
| 1681 | glLineWidth(1.5 * _screenPixelRatio); |
| 1682 | glBegin(GL_LINE_LOOP); |
| 1683 | glVertex2f( selectedKeysBRect.left(), selectedKeysBRect.bottom() ); |
| 1684 | glVertex2f( selectedKeysBRect.left(), selectedKeysBRect.top() ); |
| 1685 | glVertex2f( selectedKeysBRect.right(), selectedKeysBRect.top() ); |
| 1686 | glVertex2f( selectedKeysBRect.right(), selectedKeysBRect.bottom() ); |
| 1687 | glEnd(); |
| 1688 | |
| 1689 | // Draw center cross lines |
| 1690 | const int CROSS_LINE_OFFSET = 10; |
| 1691 | QPointF bRectCenter( (selectedKeysBRect.x1 + selectedKeysBRect.x2) / 2., (selectedKeysBRect.y1 + selectedKeysBRect.y2) / 2. ); |
| 1692 | QPointF bRectCenterWidgetCoords = zoomContext.toWidgetCoordinates( bRectCenter.x(), bRectCenter.y() ); |
| 1693 | QLineF horizontalLine( zoomContext.toZoomCoordinates( bRectCenterWidgetCoords.x() - CROSS_LINE_OFFSET, bRectCenterWidgetCoords.y() ), |
| 1694 | zoomContext.toZoomCoordinates( bRectCenterWidgetCoords.x() + CROSS_LINE_OFFSET, bRectCenterWidgetCoords.y() ) ); |
| 1695 | QLineF verticalLine( zoomContext.toZoomCoordinates(bRectCenterWidgetCoords.x(), bRectCenterWidgetCoords.y() - CROSS_LINE_OFFSET), |
| 1696 | zoomContext.toZoomCoordinates(bRectCenterWidgetCoords.x(), bRectCenterWidgetCoords.y() + CROSS_LINE_OFFSET) ); |
| 1697 | |
| 1698 | glLineWidth(1. * _screenPixelRatio); |
| 1699 | glBegin(GL_LINES); |
| 1700 | glVertex2f( horizontalLine.p1().x(), horizontalLine.p1().y() ); |
| 1701 | glVertex2f( horizontalLine.p2().x(), horizontalLine.p2().y() ); |
| 1702 | |
| 1703 | glVertex2f( verticalLine.p1().x(), verticalLine.p1().y() ); |
| 1704 | glVertex2f( verticalLine.p2().x(), verticalLine.p2().y() ); |
| 1705 | glEnd(); |
| 1706 | |
| 1707 | glCheckError(); |
| 1708 | } |
| 1709 | } |
| 1710 | |
| 1711 | void |
| 1712 | DopeSheetViewPrivate::renderText(double x, |
no test coverage detected