本文整理汇总了C++中MathCell::GetRect方法的典型用法代码示例。如果您正苦于以下问题:C++ MathCell::GetRect方法的具体用法?C++ MathCell::GetRect怎么用?C++ MathCell::GetRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MathCell
的用法示例。
在下文中一共展示了MathCell::GetRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SelectRectInOutput
void GroupCell::SelectRectInOutput(wxRect& rect, wxPoint& one, wxPoint& two,
MathCell **first, MathCell **last)
{
if (m_hide)
return;
MathCell* tmp;
wxPoint start, end;
if (one.y < two.y || (one.y == two.y && one.x < two.x)) {
start = one;
end = two;
} else {
start = two;
end = one;
}
// Lets select a rectangle
tmp = m_output;
*first = *last = NULL;
while (tmp != NULL && !rect.Intersects(tmp->GetRect()))
tmp = tmp->m_nextToDraw;
*first = tmp;
*last = tmp;
while (tmp != NULL) {
if (rect.Intersects(tmp->GetRect()))
*last = tmp;
tmp = tmp->m_nextToDraw;
}
if (*first != NULL && *last != NULL) {
// If selection is on multiple lines, we need to correct it
if ((*first)->GetCurrentY() != (*last)->GetCurrentY()) {
tmp = *last;
MathCell *curr;
// Find the first cell in selection
while (*first != tmp &&
((*first)->GetCurrentX() + (*first)->GetWidth() < start.x
|| (*first)->GetCurrentY() + (*first)->GetDrop() < start.y))
*first = (*first)->m_nextToDraw;
// Find the last cell in selection
curr = *last = *first;
while (1) {
curr = curr->m_nextToDraw;
if (curr == NULL)
break;
if (curr->GetCurrentX() <= end.x &&
curr->GetCurrentY() - curr->GetMaxCenter() <= end.y)
*last = curr;
if (curr == tmp)
break;
}
}
if (*first == *last)
(*first)->SelectInner(rect, first, last);
}
}