MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / drawSelectedKeysBRect

Method drawSelectedKeysBRect

Gui/DopeSheetView.cpp:1665–1709  ·  view source on GitHub ↗

* @brief DopeSheetViewPrivate::drawSelectedKeysBRect * * */

Source from the content-addressed store, hash-verified

1663 *
1664 */
1665void
1666DopeSheetViewPrivate::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
1711void
1712DopeSheetViewPrivate::renderText(double x,

Callers 1

paintGLMethod · 0.80

Calls 11

p1Method · 0.80
p2Method · 0.80
leftMethod · 0.45
bottomMethod · 0.45
topMethod · 0.45
rightMethod · 0.45
toWidgetCoordinatesMethod · 0.45
xMethod · 0.45
yMethod · 0.45
toZoomCoordinatesMethod · 0.45

Tested by

no test coverage detected