MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / DrawHighlightedText

Function DrawHighlightedText

DebugView++/LogView.cpp:758–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758void DrawHighlightedText(HDC hdc, const RECT& rect, std::wstring text, std::vector<Highlight> highlights, const Highlight& selection)
759{
760 InsertHighlight(highlights, selection);
761
762 AddEllipsis(hdc, text, rect.right - rect.left);
763
764 int height = GetTextSize(hdc, text, text.size()).cy;
765 POINT pos = { rect.left, rect.top + (rect.bottom - rect.top - height)/2 };
766 RECT rcHighlight = rect;
767 for (auto& highlight : highlights)
768 {
769 rcHighlight.right = rect.left + GetTextSize(hdc, text, highlight.begin).cx;
770 ExtTextOut(hdc, pos, rcHighlight, text);
771
772 rcHighlight.left = rcHighlight.right;
773 rcHighlight.right = rect.left + GetTextSize(hdc, text, highlight.end).cx;
774 {
775 Win32::ScopedTextColor txtcol(hdc, highlight.color.fore);
776 Win32::ScopedBkColor bkcol(hdc, highlight.color.back);
777 ExtTextOut(hdc, pos, rcHighlight, text);
778 }
779 rcHighlight.left = rcHighlight.right;
780 }
781 rcHighlight.right = rect.right;
782 ExtTextOut(hdc, pos, rcHighlight, text);
783}
784
785void CLogView::DrawBookmark(CDCHandle dc, int iItem) const
786{

Callers 1

DrawSubItemMethod · 0.85

Calls 5

InsertHighlightFunction · 0.85
AddEllipsisFunction · 0.85
GetTextSizeFunction · 0.85
ExtTextOutFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected