* @brief Public function for updating visible area indicator. * * @param [in] nTopLine New topline for indicator * @param [in] nBottomLine New bottomline for indicator */
| 941 | * @param [in] nBottomLine New bottomline for indicator |
| 942 | */ |
| 943 | void CLocationView::UpdateVisiblePos(int nTopLine, int nBottomLine) |
| 944 | { |
| 945 | if (m_bDrawn) |
| 946 | { |
| 947 | CMergeDoc *pDoc = GetDocument(); |
| 948 | int nGroup = pDoc->GetActiveMergeView()->m_nThisGroup; |
| 949 | int pane = 0; |
| 950 | if (std::all_of(m_nSubLineCount, m_nSubLineCount + pDoc->m_nBuffers, |
| 951 | [&](int nSubLineCount) { return nSubLineCount == pDoc->GetView(nGroup, pane++)->GetSubLineCount(); })) |
| 952 | { |
| 953 | int nTopCoord = static_cast<int>(Y_OFFSET + |
| 954 | (static_cast<double>(nTopLine * m_lineInPix))); |
| 955 | int nBottomCoord = static_cast<int>(Y_OFFSET + |
| 956 | (static_cast<double>(nBottomLine * m_lineInPix))); |
| 957 | if (m_visibleTop != nTopCoord || m_visibleBottom != nBottomCoord) |
| 958 | { |
| 959 | // Visible area was changed |
| 960 | if (m_pSavedBackgroundBitmap != nullptr) |
| 961 | { |
| 962 | CClientDC dc(this); |
| 963 | CMyMemDC dcMem(&dc); |
| 964 | // Clear previous visible rect |
| 965 | DrawBitmap(&dcMem, 0, 0, m_pSavedBackgroundBitmap.get()); |
| 966 | |
| 967 | DrawVisibleAreaRect(&dcMem, nTopLine, nBottomLine); |
| 968 | } |
| 969 | } |
| 970 | } |
| 971 | else |
| 972 | { |
| 973 | InvalidateRect(nullptr); |
| 974 | for (pane = 0; pane < pDoc->m_nBuffers; pane++) |
| 975 | m_nSubLineCount[pane] = pDoc->GetView(nGroup, pane)->GetSubLineCount(); |
| 976 | } |
| 977 | } |
| 978 | } |
| 979 | |
| 980 | /** |
| 981 | * @brief Unset pointers to MergeEditView when location pane is closed. |
no test coverage detected