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

Method paintGL

Gui/TimeLineGui.cpp:349–853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347typedef std::set<TimeLineKey, TimeLineKey_compare> TimeLineKeysSet;
348
349void
350TimeLineGui::paintGL()
351{
352 if (!_imp->gui) {
353 return;
354 }
355 if ( !appPTR->isOpenGLLoaded() ) {
356 return;
357 }
358
359
360 glCheckError();
361
362 {
363 double screenPixelRatio = _imp->viewerTab->getViewer()->getScreenPixelRatio();
364 if (screenPixelRatio != _imp->_screenPixelRatio) {
365 _imp->_screenPixelRatio = screenPixelRatio;
366 _imp->_textFont.reset(new QFont(appFont, appFontSize * screenPixelRatio));
367 }
368 }
369 assert(_imp->_textFont);
370
371 SequenceTime leftBound, rightBound;
372 {
373 QMutexLocker k(&_imp->boundariesMutex);
374 leftBound = _imp->leftBoundary;
375 rightBound = _imp->rightBoundary;
376 }
377 const SequenceTime currentTime = _imp->timeline->currentFrame();
378
379 if (_imp->firstPaint) {
380 _imp->firstPaint = false;
381
382 if ( (rightBound - leftBound) > 10000 ) {
383 centerOn(currentTime - 100, currentTime + 100);
384 } else if ( (rightBound - leftBound) < 50 ) {
385 centerOn(currentTime - DEFAULT_TIMELINE_LEFT_BOUND, currentTime + DEFAULT_TIMELINE_RIGHT_BOUND);
386 } else {
387 centerOn(leftBound, rightBound);
388 }
389 }
390
391 double w = (double)width();
392 double h = (double)height();
393 //assert(_tlZoomCtx._zoomFactor > 0);
394 if (_imp->tlZoomCtx.zoomFactor <= 0) {
395 return;
396 }
397 //assert(_tlZoomCtx._zoomFactor <= 1024);
398 double bottom = _imp->tlZoomCtx.bottom;
399 double left = _imp->tlZoomCtx.left;
400 double top = bottom + h / (double)_imp->tlZoomCtx.zoomFactor;
401 double right = left + (w / (double)_imp->tlZoomCtx.zoomFactor);
402 double clearR, clearG, clearB;
403 SettingsPtr settings = appPTR->getCurrentSettings();
404 settings->getTimelineBGColor(&clearR, &clearG, &clearB);
405
406 if ( (left == right) || (top == bottom) ) {

Callers

nothing calls this directly

Calls 15

ticks_sizeFunction · 0.85
ticks_boundsFunction · 0.85
ticks_fillFunction · 0.85
ticks_alphaFunction · 0.85
timecodeStringFunction · 0.85
renderTextFunction · 0.85
TimeLineKeyClass · 0.85
isOpenGLLoadedMethod · 0.80
getCurrentSettingsMethod · 0.80
getTimelineBGColorMethod · 0.80
isFileDialogViewerMethod · 0.80
getBaseColorMethod · 0.80

Tested by

no test coverage detected