本文整理汇总了C++中MathCell::RecalculateWidths方法的典型用法代码示例。如果您正苦于以下问题:C++ MathCell::RecalculateWidths方法的具体用法?C++ MathCell::RecalculateWidths怎么用?C++ MathCell::RecalculateWidths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MathCell
的用法示例。
在下文中一共展示了MathCell::RecalculateWidths方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BreakUpCells
void GroupCell::BreakUpCells(MathCell *cell, CellParser parser, int fontsize, int clientWidth)
{
MathCell *tmp = cell;
while (tmp != NULL && !m_hide) {
if (tmp->GetWidth() > clientWidth) {
if (tmp->BreakUp()) {
tmp->RecalculateWidths(parser, tmp->IsMath() ? m_mathFontSize : m_fontSize);
tmp->RecalculateSize(parser, tmp->IsMath() ? m_mathFontSize : m_fontSize);
}
}
tmp = tmp->m_nextToDraw;
}
}
示例2: RecalculateAppended
// We assume that appended cells will be in a new line!
void GroupCell::RecalculateAppended(CellParser& parser)
{
if (m_appendedCells == NULL)
return;
MathCell *tmp = m_appendedCells;
int fontsize = m_fontSize;
double scale = parser.GetScale();
// Recalculate widths of cells
while (tmp != NULL) {
tmp->RecalculateWidths(parser, tmp->IsMath() ? m_mathFontSize : m_fontSize);
tmp = tmp->m_next;
}
// Breakup cells and break lines
BreakUpCells(m_appendedCells, parser, fontsize, parser.GetClientWidth());
BreakLines(m_appendedCells, parser.GetClientWidth());
// Recalculate size of cells
tmp = m_appendedCells;
while (tmp != NULL) {
tmp->RecalculateSize(parser, tmp->IsMath() ? m_mathFontSize : m_fontSize);
tmp = tmp->m_next;
}
// Update widths
tmp = m_appendedCells;
while (tmp != NULL) {
if (tmp->BreakLineHere() || tmp == m_appendedCells) {
m_width = MAX(m_width, tmp->GetLineWidth(scale));
m_outputRect.width = MAX(m_outputRect.width, tmp->GetLineWidth(scale));
m_height += tmp->GetMaxHeight();
if (tmp->m_bigSkip)
m_height += MC_LINE_SKIP;
m_outputRect.height += tmp->GetMaxHeight() + MC_LINE_SKIP;
}
tmp = tmp->m_nextToDraw;
}
m_appendedCells = NULL;
}
示例3: RecalculateWidths
void Bitmap::RecalculateWidths()
{
int fontsize = 12;
wxConfig::Get()->Read(wxT("fontSize"), &fontsize);
int mfontsize = fontsize;
wxConfig::Get()->Read(wxT("mathfontsize"), &mfontsize);
MathCell* tmp = m_tree;
wxMemoryDC dc;
dc.SelectObject(m_bmp);
CellParser parser(dc);
parser.SetClientWidth(BM_FULL_WIDTH);
while (tmp != NULL)
{
tmp->RecalculateWidths(parser, tmp->IsMath() ? mfontsize : fontsize, false);
tmp = tmp->m_next;
}
}
示例4: RecalculateWidths
void GroupCell::RecalculateWidths(CellParser& parser, int fontsize)
{
if (m_width == -1 || m_height == -1 || parser.ForceUpdate())
{
// special case of 'line cell'
if (m_groupType == GC_TYPE_PAGEBREAK) {
m_width = 10;
m_height = 2;
ResetData();
return;
}
UnBreakUpCells();
double scale = parser.GetScale();
m_input->RecalculateWidthsList(parser, fontsize);
// recalculate the position of input in ReEvaluateSelection!
if (m_input->m_next != NULL) {
m_input->m_next->m_currentPoint.x = m_currentPoint.x + m_input->GetWidth() + MC_CELL_SKIP;
}
if (m_output == NULL || m_hide) {
m_width = m_input->GetFullWidth(scale);
}
else {
MathCell *tmp = m_output;
while (tmp != NULL) {
tmp->RecalculateWidths(parser, tmp->IsMath() ? m_mathFontSize : m_fontSize);
tmp = tmp->m_next;
}
// This is not correct, m_width will be computed correctly in RecalculateSize!
m_width = m_input->GetFullWidth(scale);
}
BreakUpCells(parser, m_fontSize, parser.GetClientWidth());
BreakLines(parser.GetClientWidth());
}
ResetData();
}
示例5: BreakUpCells
void Bitmap::BreakUpCells()
{
MathCell *tmp = m_tree;
int fontsize = 12;
wxConfig::Get()->Read(wxT("fontSize"), &fontsize);
int mfontsize = fontsize;
wxConfig::Get()->Read(wxT("mathfontsize"), &mfontsize);
wxMemoryDC dc;
CellParser parser(dc);
while (tmp != NULL)
{
if (tmp->GetWidth() > BM_FULL_WIDTH)
{
if (tmp->BreakUp())
{
tmp->RecalculateWidths(parser, tmp->IsMath() ? mfontsize : fontsize, false);
tmp->RecalculateSize(parser, tmp->IsMath() ? mfontsize : fontsize, false);
}
}
tmp = tmp->m_nextToDraw;
}
}