* @brief Draw maps of files. * * Draws maps of differences in files. Difference list is walked and * every difference is drawn with same colors as in editview. * @note We MUST use doubles when calculating coords to avoid rounding * to integers. Rounding causes miscalculation of coords. * @sa CLocationView::DrawRect() */
| 344 | * @sa CLocationView::DrawRect() |
| 345 | */ |
| 346 | void CLocationView::OnDraw(CDC* pDC) |
| 347 | { |
| 348 | CMergeDoc *pDoc = GetDocument(); |
| 349 | int nGroup = pDoc->GetActiveMergeView()->m_nThisGroup; |
| 350 | if (pDoc->GetView(nGroup, 0) == nullptr) |
| 351 | return; |
| 352 | |
| 353 | if (!pDoc->GetView(nGroup, 0)->IsInitialized()) return; |
| 354 | |
| 355 | bool bEditedAfterRescan = false; |
| 356 | int nPaneNotModified = -1; |
| 357 | for (int pane = 0; pane < pDoc->m_nBuffers; pane++) |
| 358 | { |
| 359 | if (!pDoc->IsEditedAfterRescan(pane)) |
| 360 | nPaneNotModified = pane; |
| 361 | else |
| 362 | bEditedAfterRescan = true; |
| 363 | } |
| 364 | |
| 365 | CRect rc; |
| 366 | GetClientRect(&rc); |
| 367 | |
| 368 | CMyMemDC dc(pDC, &rc); |
| 369 | |
| 370 | CEColor cr[3] = {CLR_NONE, CLR_NONE, CLR_NONE}; |
| 371 | CEColor crt = CLR_NONE; // Text color |
| 372 | bool bwh = false; |
| 373 | |
| 374 | m_movedLines.RemoveAll(); |
| 375 | |
| 376 | CalculateBars(); |
| 377 | DrawBackground(&dc); |
| 378 | |
| 379 | COLORREF clrFace = GetBackgroundColor(); |
| 380 | COLORREF clrShadow = GetSysColor(COLOR_BTNSHADOW); |
| 381 | COLORREF clrShadow2 = CEColor::GetIntermediateColor(clrFace, clrShadow, 0.9f); |
| 382 | COLORREF clrShadow3 = CEColor::GetIntermediateColor(clrFace, clrShadow2, 0.5f); |
| 383 | COLORREF clrShadow4 = CEColor::GetIntermediateColor(clrFace, clrShadow3, 0.5f); |
| 384 | COLORREF clrShadow5 = CEColor::GetIntermediateColor(clrFace, clrShadow4, 0.5f); |
| 385 | |
| 386 | // Draw bar outlines |
| 387 | CPen* oldObj = (CPen*)dc.SelectStockObject(NULL_PEN); |
| 388 | CBrush brush(pDoc->GetView(nGroup, 0)->GetColor(COLORINDEX_WHITESPACE)); |
| 389 | CBrush* oldBrush = (CBrush*)dc.SelectObject(&brush); |
| 390 | for (int pane = 0; pane < pDoc->m_nBuffers; pane++) |
| 391 | { |
| 392 | CBrush *pOldBrush = nullptr; |
| 393 | if (pDoc->IsEditedAfterRescan(pane)) |
| 394 | pOldBrush = (CBrush *)dc.SelectStockObject(HOLLOW_BRUSH); |
| 395 | dc.Rectangle(m_bar[pane]); |
| 396 | if (pOldBrush != nullptr) |
| 397 | dc.SelectObject(pOldBrush); |
| 398 | |
| 399 | CRect rect = m_bar[pane]; |
| 400 | rect.InflateRect(1, 1); |
| 401 | dc.Draw3dRect(rect, clrShadow5, clrShadow4); |
| 402 | rect.InflateRect(-1, -1); |
| 403 | dc.Draw3dRect(rect, clrShadow3, clrShadow2); |
nothing calls this directly
no test coverage detected