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

Method drawSelectionRect

Gui/DopeSheetView.cpp:1620–1658  ·  view source on GitHub ↗

* @brief DopeSheetViewPrivate::drawSelectionRect * * */

Source from the content-addressed store, hash-verified

1618 *
1619 */
1620void
1621DopeSheetViewPrivate::drawSelectionRect() const
1622{
1623 running_in_main_thread_and_context(q_ptr);
1624
1625 // Perform drawing
1626 {
1627 GLProtectAttrib a(GL_HINT_BIT | GL_ENABLE_BIT | GL_LINE_BIT | GL_COLOR_BUFFER_BIT | GL_CURRENT_BIT | GL_LINE_BIT);
1628
1629 glEnable(GL_BLEND);
1630 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1631 glEnable(GL_LINE_SMOOTH);
1632 glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
1633
1634 glColor4f(0.3, 0.3, 0.3, 0.2);
1635
1636 // Draw rect
1637 glBegin(GL_POLYGON);
1638 glVertex2f(selectionRect.x1, selectionRect.y1);
1639 glVertex2f(selectionRect.x1, selectionRect.y2);
1640 glVertex2f(selectionRect.x2, selectionRect.y2);
1641 glVertex2f(selectionRect.x2, selectionRect.y1);
1642 glEnd();
1643
1644 glLineWidth(1.5 * _screenPixelRatio);
1645
1646 // Draw outline
1647 glColor4f(0.5, 0.5, 0.5, 1.);
1648 glLineWidth(1.5 * _screenPixelRatio);
1649 glBegin(GL_LINE_LOOP);
1650 glVertex2f(selectionRect.x1, selectionRect.y1);
1651 glVertex2f(selectionRect.x1, selectionRect.y2);
1652 glVertex2f(selectionRect.x2, selectionRect.y2);
1653 glVertex2f(selectionRect.x2, selectionRect.y1);
1654 glEnd();
1655
1656 glCheckError();
1657 }
1658}
1659
1660/**
1661 * @brief DopeSheetViewPrivate::drawSelectedKeysBRect

Callers 1

paintGLMethod · 0.80

Calls 1

Tested by

no test coverage detected