16,472
社区成员
发帖
与我相关
我的任务
分享
for (const auto & pElement : * pDoc)
{
if(pDc->RectVisible(pElement->GetEnclosingRect()))
pElement->Draw(pDC);
}
void CSketcherView::OnDraw(CDC* pDC)
{
CSketcherDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;
// Draw the sketch
for (const auto & pElement : *pDoc)
{
if (pDC->RectVisible(pElement->GetEnclosingRect())) // Element visible?
pElement->Draw(pDC, m_pSelected); // Yes, draw it
}
}