MCPcopy Create free account
hub / github.com/SpartanJ/eepp / drawMatchingBrackets

Method drawMatchingBrackets

src/eepp/ui/uicodeeditor.cpp:3910–3928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3908}
3909
3910void UICodeEditor::drawMatchingBrackets( const Vector2f& startScroll, const Float& lineHeight ) {
3911 if ( mMatchingBrackets.isValid() ) {
3912 Primitives primitive;
3913 primitive.setForceDraw( false );
3914 primitive.setColor( Color( mMatchingBracketColor ).blendAlpha( mAlpha ) );
3915 auto drawBracket = [&]( const TextPosition& pos ) {
3916 auto info = mDocView.getVisibleLineRange( pos );
3917 if ( !info.range.isValid() )
3918 return;
3919 auto offset = getTextPositionOffset( pos, lineHeight );
3920 primitive.drawRectangle(
3921 Rectf( Vector2f( startScroll.x + offset.x, startScroll.y + offset.y ),
3922 Sizef( getGlyphWidth(), lineHeight ) ) );
3923 };
3924 drawBracket( mMatchingBrackets.start() );
3925 drawBracket( mMatchingBrackets.end() );
3926 primitive.setForceDraw( true );
3927 }
3928}
3929
3930void UICodeEditor::drawSelectionMatch( const DocumentLineRange& lineRange,
3931 const Vector2f& startScroll, const Float& lineHeight,

Callers

nothing calls this directly

Calls 7

setForceDrawMethod · 0.80
isValidMethod · 0.45
setColorMethod · 0.45
getVisibleLineRangeMethod · 0.45
drawRectangleMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected