| 453 | } |
| 454 | |
| 455 | void UICodeEditor::scheduledUpdate( const Time& ) { |
| 456 | if ( mDisableCursorBlinkingAfterAMinuteOfInactivity && |
| 457 | mLastActivity.getElapsedTime() > Seconds( 60 ) ) { |
| 458 | if ( !mCursorVisible ) { |
| 459 | mCursorVisible = true; |
| 460 | invalidateDraw(); |
| 461 | } |
| 462 | } else if ( hasFocus() && getUISceneNode()->getWindow()->hasFocus() ) { |
| 463 | if ( mBlinkTime != Time::Zero && mBlinkTimer.getElapsedTime() > mBlinkTime ) { |
| 464 | mCursorVisible = !mCursorVisible; |
| 465 | mBlinkTimer.restart(); |
| 466 | invalidateDraw(); |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | if ( mMouseDown || mMouseDownMinimap ) { |
| 471 | if ( !( getInput()->getPressTrigger() & EE_BUTTON_LMASK ) ) { |
| 472 | stopMinimapDragging( getInput()->getMousePos().asFloat() ); |
| 473 | mMouseDown = false; |
| 474 | mMouseDownMinimap = false; |
| 475 | getInput()->captureMouse( false ); |
| 476 | } else if ( !isMouseOverMeOrChildren() || mMinimapDragging ) { |
| 477 | onMouseMove( getUISceneNode()->getEventDispatcher()->getMousePos(), |
| 478 | getUISceneNode()->getEventDispatcher()->getPressTrigger() ); |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | if ( !mVisible ) |
| 483 | return; |
| 484 | |
| 485 | if ( mDoc && !mDoc->isLoading() && !mDoc->isEmpty() && |
| 486 | !mDoc->getSyntaxDefinition().getPatterns().empty() && |
| 487 | mDoc->getHighlighter()->updateDirty( getVisibleLinesCount() ) ) { |
| 488 | invalidateDraw(); |
| 489 | } |
| 490 | |
| 491 | if ( mDoc && !mDoc->isLoading() && needsHorizontalLength() && isVisible() && |
| 492 | mLongestLineWidthDirty && |
| 493 | mLongestLineWidthLastUpdate.getElapsedTime() > mFindLongestLineWidthUpdateFrequency ) { |
| 494 | updateLongestLineWidth(); |
| 495 | } |
| 496 | |
| 497 | for ( auto& plugin : mPlugins ) |
| 498 | plugin->update( this ); |
| 499 | } |
| 500 | |
| 501 | void UICodeEditor::updateLongestLineWidth() { |
| 502 | if ( needsHorizontalLength() && mDoc && !mDoc->isLoading() && !mDoc->isRunningTransaction() ) { |
nothing calls this directly
no test coverage detected