Esempio n. 1
0
void FracCell::RecalculateWidths(CellParser& parser, int fontsize, bool all)
{
  double scale = parser.GetScale();
  if (m_isBroken || m_exponent)
  {
    m_num->RecalculateWidths(parser, fontsize, true);
    m_denom->RecalculateWidths(parser, fontsize, true);
  }
  else
  {
    m_num->RecalculateWidths(parser, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC), true);
    m_denom->RecalculateWidths(parser, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC), true);
  }
  if (m_exponent && !m_isBroken)
  {
    wxDC& dc = parser.GetDC();
    int height;
    int fontsize1 = (int) ((double)(fontsize) * scale + 0.5);
    dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
                            false, false, false,
                            parser.GetFontName(TS_VARIABLE)));
    dc.GetTextExtent(wxT("/"), &m_expDivideWidth, &height);
    m_width = m_num->GetFullWidth(scale) + m_denom->GetFullWidth(scale) + m_expDivideWidth;
  }
  else
  {
    m_width = MAX(m_num->GetFullWidth(scale), m_denom->GetFullWidth(scale));
  }
  m_open1->RecalculateWidths(parser, fontsize, false);
  m_close1->RecalculateWidths(parser, fontsize, false);
  m_open2->RecalculateWidths(parser, fontsize, false);
  m_close2->RecalculateWidths(parser, fontsize, false);
  m_divide->RecalculateWidths(parser, fontsize, false);
  MathCell::RecalculateWidths(parser, fontsize, all);
}
Esempio n. 2
0
/***
 * Reset the pen in the device context.
 */
void MathCell::UnsetPen(CellParser& parser)
{
  wxDC& dc = parser.GetDC();
  if (m_type == MC_TYPE_PROMPT || m_type == MC_TYPE_INPUT || m_highlight)
    dc.SetPen(*(wxThePenList->FindOrCreatePen(parser.GetColor(TS_DEFAULT),
                1, wxPENSTYLE_SOLID)));
}
Esempio n. 3
0
void ImgCell::Draw(CellParser& parser, wxPoint point, int fontsize)
{
  wxDC& dc = parser.GetDC();

  if (DrawThisCell(parser, point) && m_image != NULL)
  {
    wxMemoryDC bitmapDC;
    double scale = parser.GetScale();
    m_image->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
    m_height = (m_image->m_height) + 2 * m_imageBorderWidth;
    m_width  = (m_image->m_width)  + 2 * m_imageBorderWidth;

    SetPen(parser);
    if (m_drawRectangle)
      
      dc.DrawRectangle(wxRect(point.x, point.y - m_center, m_width, m_height));  

    wxBitmap bitmap = m_image->GetBitmap();
    bitmapDC.SelectObject(bitmap);
      
    dc.Blit(point.x + m_imageBorderWidth, point.y - m_center + m_imageBorderWidth, m_width - 2 * m_imageBorderWidth, m_height - 2 * m_imageBorderWidth, &bitmapDC, 0, 0);
  }
  else
    // The cell isn't drawn => No need to keep it's image cache for now.
    ClearCache();

  MathCell::Draw(parser, point, fontsize);
}
Esempio n. 4
0
void SlideShow::Draw(CellParser& parser, wxPoint point, int fontsize, bool all)
{
  if (DrawThisCell(parser, point) && m_bitmaps[m_displayed] != NULL)
  {
    wxDC& dc = parser.GetDC();
    wxMemoryDC bitmapDC;
    double scale = parser.GetScale();
    scale = MAX(scale, 1.0);

    dc.DrawRectangle(wxRect(point.x, point.y - m_center, m_width, m_height));

    if (scale != 1.0)
    {
      wxImage img = m_bitmaps[m_displayed]->ConvertToImage();
      img.Rescale(m_width, m_height);

      wxBitmap bmp = img;
      bitmapDC.SelectObject(bmp);
    }
    else
      bitmapDC.SelectObject(*m_bitmaps[m_displayed]);

    dc.Blit(point.x + 1, point.y - m_center + 1, m_width, m_height, &bitmapDC, 0, 0);
  }
  MathCell::Draw(parser, point, fontsize, all);
}
Esempio n. 5
0
void IntCell::RecalculateSize(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();

  m_under->RecalculateSizeList(parser, MAX(MC_MIN_SIZE, fontsize - 5));
  m_over->RecalculateSizeList(parser, MAX(MC_MIN_SIZE, fontsize - 5));
  m_base->RecalculateSizeList(parser, fontsize);
  m_var->RecalculateSizeList(parser, fontsize);

  if (m_intStyle == INT_DEF)
  {
    if (parser.CheckTeXFonts())
    {
      m_center = MAX(m_over->GetMaxHeight() + SCALE_PX(4, scale) + m_signSize / 2 - m_signSize / 3,
                     m_base->GetMaxCenter());
      m_height = m_center +
                 MAX(m_under->GetMaxHeight() + SCALE_PX(4, scale) + m_signSize / 2 - m_signSize / 3,
                     m_base->GetMaxDrop());
    }
    else
    {
      m_center = MAX(m_over->GetMaxHeight() + SCALE_PX(4, scale) + m_signSize / 2 - m_signSize / 3,
                     m_base->GetMaxCenter());
      m_height = m_center +
                 MAX(m_under->GetMaxHeight() + SCALE_PX(4, scale) + m_signSize / 2 - m_signSize / 3,
                     m_base->GetMaxDrop());
    }
  }
  else
  {
    m_center = MAX(m_signSize / 2, m_base->GetMaxCenter());
    m_height = m_center +
      MAX(m_signSize / 2, m_base->GetMaxDrop());
  }
}
Esempio n. 6
0
void FracCell::RecalculateSize(int fontsize)
{
  CellParser *parser = CellParser::Get();
  double scale = parser->GetScale();
  if (m_isBroken || m_exponent)
  {
    m_num->RecalculateSizeList(fontsize);
    m_denom->RecalculateSizeList(fontsize);
  }
  else
  {
    m_num->RecalculateSizeList(MAX(MC_MIN_SIZE, fontsize - FRAC_DEC));
    m_denom->RecalculateSizeList(MAX(MC_MIN_SIZE, fontsize - FRAC_DEC));
  }
  if (!m_exponent)
  {
    m_height = m_num->GetMaxHeight() + m_denom->GetMaxHeight() +
               SCALE_PX(4, scale);
    m_center = m_num->GetMaxHeight() + SCALE_PX(2, scale);
  }
  else
  {
    m_height = m_num->GetMaxHeight();
    m_center = m_height / 2;
  }

  m_open1->RecalculateSize(fontsize);
  m_close1->RecalculateSize(fontsize);
  m_open2->RecalculateSize(fontsize);
  m_close2->RecalculateSize(fontsize);
  m_divide->RecalculateSize(fontsize);
  MathCell::RecalculateSize(fontsize);
}
Esempio n. 7
0
void ParenCell::RecalculateSize(CellParser& parser, int fontsize, bool all)
{
    double scale = parser.GetScale();
    m_innerCell->RecalculateSize(parser, fontsize, true);
    m_height = m_innerCell->GetMaxHeight() + SCALE_PX(2, scale);
    m_center = m_innerCell->GetMaxCenter() + SCALE_PX(1, scale);

#if defined __WXMSW__
    if (!parser.CheckTeXFonts())
    {
        wxDC& dc = parser.GetDC();
        int fontsize1 = (int) ((fontsize * scale + 0.5));
        dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
                          false,
                          false,
                          false,
                          parser.GetFontName()));
        dc.GetTextExtent(wxT("("), &m_charWidth1, &m_charHeight1);
    }
#endif

    m_open->RecalculateSize(parser, fontsize, false);
    m_close->RecalculateSize(parser, fontsize, false);
    MathCell::RecalculateSize(parser, fontsize, all);
}
Esempio n. 8
0
void SubCell::RecalculateWidths(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_baseCell->RecalculateWidthsList(parser, fontsize);
  m_indexCell->RecalculateWidthsList(parser, MAX(MC_MIN_SIZE, fontsize - SUB_DEC));
  m_width = m_baseCell->GetFullWidth(scale) + m_indexCell->GetFullWidth(scale) -
            SCALE_PX(2, parser.GetScale());
  ResetData();
}
Esempio n. 9
0
void SubCell::RecalculateWidths(CellParser& parser, int fontsize, bool all)
{
  double scale = parser.GetScale();
  m_baseCell->RecalculateWidths(parser, fontsize, true);
  m_indexCell->RecalculateWidths(parser, MAX(MC_MIN_SIZE, fontsize - SUB_DEC), true);
  m_width = m_baseCell->GetFullWidth(scale) + m_indexCell->GetFullWidth(scale) -
            SCALE_PX(2, parser.GetScale());
  MathCell::RecalculateWidths(parser, fontsize, all);
}
Esempio n. 10
0
void DiffCell::RecalculateWidths(int fontsize)
{
  CellParser *parser = CellParser::Get();
  double scale = parser->GetScale();
  m_baseCell->RecalculateWidthsList(fontsize);
  m_diffCell->RecalculateWidthsList(fontsize);
  m_width = m_baseCell->GetFullWidth(scale) + m_diffCell->GetFullWidth(scale) + 2*MC_CELL_SKIP;
  ResetData();
}
Esempio n. 11
0
/*! Is this cell currently visible in the window?.
 */
bool MathCell::DrawThisCell(CellParser& parser, wxPoint point)
{
  int top = parser.GetTop();
  int bottom = parser.GetBottom();
  if (top == -1 || bottom == -1)
    return true;
  if (point.y - GetMaxCenter() > bottom || point.y + GetMaxDrop() < top)
    return false;
  return true;
}
Esempio n. 12
0
void SqrtCell::RecalculateSize(int fontsize)
{
  CellParser *parser = CellParser::Get();
  double scale = parser->GetScale();
  m_innerCell->RecalculateSizeList(fontsize);
  m_height = m_innerCell->GetMaxHeight() + SCALE_PX(3, scale);
  m_center = m_innerCell->GetMaxCenter() + SCALE_PX(3, scale);
  m_open->RecalculateSizeList(fontsize);
  m_close->RecalculateSizeList(fontsize);
}
Esempio n. 13
0
void SqrtCell::RecalculateWidths(int fontsize)
{
  CellParser *parser = CellParser::Get();
  double scale = parser->GetScale();
  m_innerCell->RecalculateWidthsList(fontsize);
  if (parser->CheckTeXFonts())
  {
    wxDC& dc = parser->GetDC();
    double scale = parser->GetScale();
    m_innerCell->RecalculateSizeList(fontsize);

    m_signFontScale = 1.0;
    int fontsize1 = (int)(SIGN_FONT_SCALE*scale*fontsize*m_signFontScale + 0.5);

    dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, parser->GetTeXCMEX()));
    dc.GetTextExtent(wxT("s"), &m_signWidth, &m_signSize);
    m_signTop = m_signSize / 5;
    m_width = m_innerCell->GetFullWidth(scale) + m_signWidth;

    int size = m_innerCell->GetMaxHeight();

    if  (size <= (m_signSize) / 5)  {
      m_signType = 1;
      m_signFontScale = (5.0 * size) / (1.5 * m_signSize);
    }
    else if (size <= (2*m_signSize) / 5) {
      m_signType = 2;
      m_signFontScale = (5.0 * size) / (2.2 * m_signSize);
    }
    else if (size <= (3*m_signSize) / 5) {
      m_signType = 3;
      m_signFontScale = (5.0 * size) / (3.0 * m_signSize);
    }
    else if (size <= (4*m_signSize) / 5 ) {
      m_signType = 4;
      m_signFontScale = (5.0 * size) / (3.8 * m_signSize);
    }
    else {
      m_signType = 5;
      m_signFontScale = 1.0;
    }

    fontsize1 = (int)(SIGN_FONT_SCALE*scale*fontsize*m_signFontScale + 0.5);
    dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, parser->GetTeXCMEX()));
    dc.GetTextExtent(wxT("s"), &m_signWidth, &m_signSize);
    m_signTop = m_signSize / 5;
    m_width = m_innerCell->GetFullWidth(scale) + m_signWidth;
  }
  else
    m_width = m_innerCell->GetFullWidth(scale) + SCALE_PX(10, scale) +
              3 * SCALE_PX(1, scale) + 1;
  m_open->RecalculateWidthsList(fontsize);
  m_close->RecalculateWidthsList(fontsize);
  ResetData();
}
Esempio n. 14
0
void GroupCell::RecalculateSize(CellParser& parser, int fontsize)
{
  if (m_width == -1 || m_height == -1 || parser.ForceUpdate())
  {
    // special case
    if (m_groupType == GC_TYPE_PAGEBREAK) {
      m_width = 10;
      m_height = 2;
      m_center = 0;
      m_indent = 0;
      MathCell::RecalculateWidthsList(parser, fontsize);
      return;
    }

    double scale = parser.GetScale();
    m_input->RecalculateSizeList(parser, fontsize);
    m_center = m_input->GetMaxCenter();
    m_height = m_input->GetMaxHeight();
    m_indent = parser.GetIndent();

    if (m_output != NULL && !m_hide) {
      MathCell *tmp = m_output;
      while (tmp != NULL) {
        tmp->RecalculateSize(parser,  tmp->IsMath() ? m_mathFontSize : m_fontSize);
        tmp = tmp->m_next;
      }

      m_outputRect.x = m_currentPoint.x;
      m_outputRect.y = m_currentPoint.y - m_output->GetMaxCenter();
      m_outputRect.width = 0;
      m_outputRect.height = 0;
      m_height = m_input->GetMaxHeight();
      m_width = m_input->GetFullWidth(scale);

      tmp = m_output;
      while (tmp != NULL) {
        if (tmp->BreakLineHere() || tmp == m_output) {
          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;
}
Esempio n. 15
0
void SlideShow::RecalculateWidths(int fontsize)
{
  // Here we recalculate the height, as well:
  //  - This doesn't cost much time and
  //  - as image cell's sizes might change when the resolution does
  //    we might have intermittent calculation issues otherwise
  CellParser *parser = CellParser::Get();
  double scale = parser->GetScale();
  m_images[m_displayed]->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
  m_width  = (scale * m_images[m_displayed]->m_width)  + 2 * m_imageBorderWidth;
  m_height = (scale * m_images[m_displayed]->m_height) + 2 * m_imageBorderWidth;
  m_center = m_height / 2;
}
Esempio n. 16
0
void SubSupCell::RecalculateSize(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();

  m_baseCell->RecalculateSizeList(parser, fontsize);
  m_indexCell->RecalculateSizeList(parser, MAX(MC_MIN_SIZE, fontsize - SUBSUP_DEC));
  m_exptCell->RecalculateSizeList(parser, MAX(MC_MIN_SIZE, fontsize - SUBSUP_DEC));

  m_height = m_baseCell->GetMaxHeight() + m_indexCell->GetMaxHeight() +
             m_exptCell->GetMaxHeight() -
             2*SCALE_PX((8 * fontsize) / 10 + MC_EXP_INDENT, parser.GetScale());

  m_center = m_exptCell->GetMaxHeight() + m_baseCell->GetMaxCenter() -
             SCALE_PX((8 * fontsize) / 10 + MC_EXP_INDENT, scale);
}
Esempio n. 17
0
void FracCell::Draw(wxPoint point, int fontsize)
{
  MathCell::Draw(point, fontsize);
  CellParser *parser = CellParser::Get();

  if (DrawThisCell(point) && InUpdateRegion())
  {
    wxDC& dc = parser->GetDC();
    double scale = parser->GetScale();
    wxPoint num, denom;

    if (m_exponent && !m_isBroken)
    {
      double scale = parser->GetScale();
      
      num.x = point.x;
      num.y = point.y;
      denom.x = point.x + m_num->GetFullWidth(scale) + m_expDivideWidth;
      denom.y = num.y;

      m_num->DrawList(num, fontsize);
      m_denom->DrawList(denom, fontsize);

      int fontsize1 = (int) ((double)(fontsize) * scale + 0.5);
      dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
    		  wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false,
    		  parser->GetFontName(TS_VARIABLE)));
      dc.DrawText(wxT("/"),
                  point.x + m_num->GetFullWidth(scale),
                  point.y - m_num->GetMaxCenter() + SCALE_PX(MC_TEXT_PADDING, scale));
    }
    else
    {      
      num.x = point.x + (m_width - m_num->GetFullWidth(scale)) / 2;
      num.y = point.y - m_num->GetMaxHeight() + m_num->GetMaxCenter() -
              SCALE_PX(2, scale);
      m_num->DrawList(num, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC));

      denom.x = point.x + (m_width - m_denom->GetFullWidth(scale)) / 2;
      denom.y = point.y + m_denom->GetMaxCenter() + SCALE_PX(2, scale);
      m_denom->DrawList(denom, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC));
      SetPen();
      if (m_fracStyle != FC_CHOOSE)
        dc.DrawLine(point.x + m_horizontalGap, point.y, point.x + m_width - m_horizontalGap, point.y);
      UnsetPen();
    }
  }
}
Esempio n. 18
0
void SubSupCell::Draw(CellParser& parser, wxPoint point, int fontsize, bool all)
{
  if (DrawThisCell(parser, point))
  {
    double scale = parser.GetScale();
    wxPoint bs, in;

    bs.x = point.x;
    bs.y = point.y;
    m_baseCell->Draw(parser, bs, fontsize, true);

    in.x = point.x + m_baseCell->GetFullWidth(scale) - SCALE_PX(2, scale);
    in.y = point.y + m_baseCell->GetMaxDrop() +
           m_indexCell->GetMaxCenter() -
           SCALE_PX((8 * fontsize) / 10 + MC_EXP_INDENT, scale);
    m_indexCell->Draw(parser, in, MAX(MC_MIN_SIZE, fontsize - SUBSUP_DEC), true);

    in.y = point.y - m_baseCell->GetMaxCenter() - m_exptCell->GetMaxHeight()
           + m_exptCell->GetMaxCenter() +
           SCALE_PX((8 * fontsize) / 10 + MC_EXP_INDENT, scale);
    m_exptCell->Draw(parser, in, MAX(MC_MIN_SIZE, fontsize - SUBSUP_DEC), true);
  }

  MathCell::Draw(parser, point, fontsize, all);
}
Esempio n. 19
0
void LimitCell::Draw(CellParser& parser, wxPoint point, int fontsize, bool all)
{
  if (DrawThisCell(parser, point))
  {
    double scale = parser.GetScale();
    wxPoint base(point), under(point), name(point);

    name.x = point.x + MAX(m_name->GetFullWidth(scale),
                           m_under->GetFullWidth(scale)) / 2 -
             m_name->GetFullWidth(scale) / 2;
    m_name->Draw(parser, name, fontsize, true);

    under.x = point.x + MAX(m_name->GetFullWidth(scale),
                            m_under->GetFullWidth(scale)) / 2 -
              m_under->GetFullWidth(scale) / 2;
    under.y = point.y + m_name->GetMaxDrop() + m_under->GetMaxCenter();
    m_under->Draw(parser, under, MAX(MIN_LIMIT_FONT_SIZE, fontsize - LIMIT_FONT_SIZE_DECREASE), true);

    base.x += MAX(m_name->GetFullWidth(scale),
                  m_under->GetFullWidth(scale));
    m_base->Draw(parser, base, fontsize, true);
  }

  MathCell::Draw(parser, point, fontsize, all);
}
Esempio n. 20
0
void SlideShow::RecalculateWidths(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_images[m_displayed]->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
  m_width = (scale * m_images[m_displayed]->m_width) + 2 * m_imageBorderWidth;
}
Esempio n. 21
0
void FracCell::RecalculateSize(CellParser& parser, int fontsize, bool all)
{
  double scale = parser.GetScale();
  if (m_isBroken || m_exponent)
  {
    m_num->RecalculateSize(parser, fontsize, true);
    m_denom->RecalculateSize(parser, fontsize, true);
  }
  else
  {
    m_num->RecalculateSize(parser, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC), true);
    m_denom->RecalculateSize(parser, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC), true);
  }
  if (!m_exponent)
  {
    m_height = m_num->GetMaxHeight() + m_denom->GetMaxHeight() +
               SCALE_PX(4, scale);
    m_center = m_num->GetMaxHeight() + SCALE_PX(2, scale);
  }
  else
  {
    m_height = m_num->GetMaxHeight();
    m_center = m_height / 2;
  }

  m_open1->RecalculateSize(parser, fontsize, false);
  m_close1->RecalculateSize(parser, fontsize, false);
  m_open2->RecalculateSize(parser, fontsize, false);
  m_close2->RecalculateSize(parser, fontsize, false);
  m_divide->RecalculateSize(parser, fontsize, false);
  MathCell::RecalculateSize(parser, fontsize, all);
}
Esempio n. 22
0
void DiffCell::Draw(wxPoint point, int fontsize)
{
  MathCell::Draw(point, fontsize);

  if (DrawThisCell(point) && InUpdateRegion()) {
    wxPoint bs, df;
    df.x = point.x;
    df.y = point.y;
    m_diffCell->DrawList(df, fontsize);

    CellParser *parser = CellParser::Get();
    bs.x = point.x + m_diffCell->GetFullWidth(parser->GetScale()) + 2*MC_CELL_SKIP;
    bs.y = point.y;
    m_baseCell->DrawList(bs, fontsize);
  }
}
Esempio n. 23
0
void FracCell::Draw(CellParser& parser, wxPoint point, int fontsize, bool all)
{
  if (DrawThisCell(parser, point))
  {
    wxDC& dc = parser.GetDC();
    double scale = parser.GetScale();
    wxPoint num, denom;

    if (m_exponent && !m_isBroken)
    {
      double scale = parser.GetScale();

      num.x = point.x;
      num.y = point.y;
      denom.x = point.x + m_num->GetFullWidth(scale) + m_expDivideWidth;
      denom.y = num.y;

      m_num->Draw(parser, num, fontsize, true);
      m_denom->Draw(parser, denom, fontsize, true);

      int fontsize1 = (int) ((double)(fontsize) * scale + 0.5);
      dc.SetFont(wxFont(fontsize1, wxFONTFAMILY_MODERN,
                              false, false, false,
                              parser.GetFontName(TS_VARIABLE)));
      dc.DrawText(wxT("/"),
                  point.x + m_num->GetFullWidth(scale),
                  point.y - m_num->GetMaxCenter() + SCALE_PX(MC_TEXT_PADDING, scale));
    }
    else
    {
      num.x = point.x + (m_width - m_num->GetFullWidth(scale)) / 2;
      num.y = point.y - m_num->GetMaxHeight() + m_num->GetMaxCenter() -
              SCALE_PX(2, scale);
      m_num->Draw(parser, num, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC), true);

      denom.x = point.x + (m_width - m_denom->GetFullWidth(scale)) / 2;
      denom.y = point.y + m_denom->GetMaxCenter() + SCALE_PX(2, scale);
      m_denom->Draw(parser, denom, MAX(MC_MIN_SIZE, fontsize - FRAC_DEC), true);
      SetPen(parser);
      if (m_fracStyle != FC_CHOOSE)
        dc.DrawLine(point.x, point.y, point.x + m_width, point.y);
      UnsetPen(parser);
    }
  }

  MathCell::Draw(parser, point, fontsize, all);
}
Esempio n. 24
0
void DiffCell::RecalculateWidths(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_baseCell->RecalculateWidthsList(parser, fontsize);
  m_diffCell->RecalculateWidthsList(parser, fontsize);
  m_width = m_baseCell->GetFullWidth(scale) + m_diffCell->GetFullWidth(scale) + 2*MC_CELL_SKIP;
  ResetData();
}
Esempio n. 25
0
void ImgCell::RecalculateWidths(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_image->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
  m_width = (scale * m_image->m_width) + 2 * m_imageBorderWidth;
  ResetData();
}
Esempio n. 26
0
void ConjugateCell::RecalculateWidths(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_innerCell->RecalculateWidthsList(parser, fontsize);
  m_width = m_innerCell->GetFullWidth(scale) + SCALE_PX(8, scale);
  m_open->RecalculateWidthsList(parser, fontsize);
  m_close->RecalculateWidthsList(parser, fontsize);
  ResetData();
}
Esempio n. 27
0
void SlideShow::RecalculateSize(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_images[m_displayed]->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
  m_height = (scale * m_images[m_displayed]->m_height) + 2 * m_imageBorderWidth;

  m_center = m_height / 2;
}
Esempio n. 28
0
void SqrtCell::RecalculateSize(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_innerCell->RecalculateSizeList(parser, fontsize);
  m_height = m_innerCell->GetMaxHeight() + SCALE_PX(3, scale);
  m_center = m_innerCell->GetMaxCenter() + SCALE_PX(3, scale);
  m_open->RecalculateSizeList(parser, fontsize);
  m_close->RecalculateSizeList(parser, fontsize);
}
Esempio n. 29
0
void SubCell::RecalculateSize(CellParser& parser, int fontsize, bool all)
{
  m_baseCell->RecalculateSize(parser, fontsize, true);
  m_indexCell->RecalculateSize(parser, MAX(MC_MIN_SIZE, fontsize - SUB_DEC), true);
  m_height = m_baseCell->GetMaxHeight() + m_indexCell->GetMaxHeight() -
             SCALE_PX((8 * fontsize) / 10 + MC_EXP_INDENT, parser.GetScale());
  m_center = m_baseCell->GetCenter();
  MathCell::RecalculateSize(parser, fontsize, all);
}
Esempio n. 30
0
void ImgCell::RecalculateSize(CellParser& parser, int fontsize)
{
  double scale = parser.GetScale();
  m_image->ViewportSize(m_canvasSize.x,m_canvasSize.y,scale);
  
  m_height = (scale * m_image->m_height) + 2 * m_imageBorderWidth;
  ResetData();

  m_center = m_height / 2;
}