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

Method GetSelectionHighlight

DebugView++/LogView.cpp:808–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

806}
807
808Highlight CLogView::GetSelectionHighlight(CDCHandle dc, int iItem) const
809{
810 auto rect = GetSubItemRect(iItem, ColumnToSubItem(Column::Message), LVIR_BOUNDS);
811 auto dragStart = m_dragStart;
812 dragStart.x -= GetScrollPos(SB_HORZ);
813 auto dragEnd = m_dragEnd;
814 dragEnd.x -= GetScrollPos(SB_HORZ);
815 if (!m_dragging || !Contains(rect, dragStart))
816 return Highlight(0, 0, 0, TextColor(0, 0));
817
818 int x1 = std::min(dragStart.x, dragEnd.x);
819 int x2 = std::max(dragStart.x, dragEnd.x);
820
821 int begin = GetTextIndex(dc, iItem, x1);
822 int end = GetTextIndex(dc, iItem, x2);
823 return Highlight(0, begin, end, TextColor(Colors::Selection, Colors::Text));
824}
825
826void CLogView::DrawSubItem(CDCHandle dc, int iItem, int iSubItem, const ItemData& data) const
827{

Callers

nothing calls this directly

Calls 3

ContainsFunction · 0.85
HighlightClass · 0.85
TextColorClass · 0.85

Tested by

no test coverage detected