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

Method drawCurrentFrameIndicator

Gui/DopeSheetView.cpp:1561–1613  ·  view source on GitHub ↗

* @brief DopeSheetViewPrivate::drawIndicator * * */

Source from the content-addressed store, hash-verified

1559 *
1560 */
1561void
1562DopeSheetViewPrivate::drawCurrentFrameIndicator()
1563{
1564 running_in_main_thread_and_context(q_ptr);
1565
1566 computeTimelinePositions();
1567
1568 int top = zoomContext.toZoomCoordinates(0, 0).y();
1569 int bottom = zoomContext.toZoomCoordinates(q_ptr->width() - 1,
1570 q_ptr->height() - 1).y();
1571 int currentFrame = timeline->currentFrame();
1572
1573 // Retrieve settings for drawing
1574 SettingsPtr settings = appPTR->getCurrentSettings();
1575 double colorR, colorG, colorB;
1576 settings->getTimelinePlayheadColor(&colorR, &colorG, &colorB);
1577
1578 // Perform drawing
1579 {
1580 GLProtectAttrib a(GL_CURRENT_BIT | GL_HINT_BIT | GL_ENABLE_BIT |
1581 GL_LINE_BIT | GL_POLYGON_BIT | GL_COLOR_BUFFER_BIT);
1582
1583 glEnable(GL_BLEND);
1584 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
1585
1586 glEnable(GL_LINE_SMOOTH);
1587 glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
1588
1589 glColor4f(colorR, colorG, colorB, 1.f);
1590 glLineWidth(1. * _screenPixelRatio);
1591 glBegin(GL_LINES);
1592 glVertex2f(currentFrame, top);
1593 glVertex2f(currentFrame, bottom);
1594 glEnd();
1595
1596 glEnable(GL_POLYGON_SMOOTH);
1597 glHint(GL_POLYGON_SMOOTH_HINT, GL_DONT_CARE);
1598
1599 // Draw top polygon
1600 // glBegin(GL_POLYGON);
1601 // glVertex2f(currentTime - polyHalfWidth, top);
1602 // glVertex2f(currentTime + polyHalfWidth, top);
1603 // glVertex2f(currentTime, top - polyHeight);
1604 // glEnd();
1605
1606 // Draw bottom polygon
1607 glBegin(GL_POLYGON);
1608 glVertex2f( currentFrameIndicatorBottomPoly.at(0).x(), currentFrameIndicatorBottomPoly.at(0).y() );
1609 glVertex2f( currentFrameIndicatorBottomPoly.at(1).x(), currentFrameIndicatorBottomPoly.at(1).y() );
1610 glVertex2f( currentFrameIndicatorBottomPoly.at(2).x(), currentFrameIndicatorBottomPoly.at(2).y() );
1611 glEnd();
1612 }
1613} // DopeSheetViewPrivate::drawCurrentFrameIndicator
1614
1615/**
1616 * @brief DopeSheetViewPrivate::drawSelectionRect

Callers 1

paintGLMethod · 0.80

Calls 10

getCurrentSettingsMethod · 0.80
atMethod · 0.80
yMethod · 0.45
toZoomCoordinatesMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45
currentFrameMethod · 0.45
xMethod · 0.45

Tested by

no test coverage detected