Attachment #8404896: Patch for bug #960115

View | Details | Raw Unified | Return to bug 960115
Collapse All | Expand All

(-)a/layout/mathml/nsMathMLChar.cpp (-1 / +5 lines)
Line     Link Here 
 Lines 1764-1779   nsMathMLChar::StretchInternal(nsPresCont Link Here 
1764
  }
1764
  }
1765
1765
1766
  if (!maxWidth) {
1766
  if (!maxWidth) {
1767
    // Now, we know how we are going to draw the char. Update the member
1767
    // Now, we know how we are going to draw the char. Update the member
1768
    // variables accordingly.
1768
    // variables accordingly.
1769
    mUnscaledAscent = aDesiredStretchSize.ascent;
1769
    mUnscaledAscent = aDesiredStretchSize.ascent;
1770
  }
1770
  }
1771
    
1771
    
1772
  if (glyphFound) {
1773
    return NS_OK;
1774
  }
1775
1772
  // stretchy character
1776
  // stretchy character
1773
  if (stretchy) {
1777
  if (stretchy) {
1774
    if (isVertical) {
1778
    if (isVertical) {
1775
      float scale =
1779
      float scale =
1776
        float(aContainerSize.ascent + aContainerSize.descent) /
1780
        float(aContainerSize.ascent + aContainerSize.descent) /
1777
        (aDesiredStretchSize.ascent + aDesiredStretchSize.descent);
1781
        (aDesiredStretchSize.ascent + aDesiredStretchSize.descent);
1778
      if (!largeop || scale > 1.0) {
1782
      if (!largeop || scale > 1.0) {
1779
        // make the character match the desired height.
1783
        // make the character match the desired height.
 Lines 1796-1812   nsMathMLChar::StretchInternal(nsPresCont Link Here 
1796
        aDesiredStretchSize.rightBearing *= scale;
1800
        aDesiredStretchSize.rightBearing *= scale;
1797
        aDesiredStretchSize.width *= scale;
1801
        aDesiredStretchSize.width *= scale;
1798
      }
1802
      }
1799
    }
1803
    }
1800
  }
1804
  }
1801
1805
1802
  // We do not have a char variant for this largeop in display mode, so we
1806
  // We do not have a char variant for this largeop in display mode, so we
1803
  // apply a scale transform to the base char.
1807
  // apply a scale transform to the base char.
1804
  if (!glyphFound && largeop) {
1808
  if (largeop) {
1805
    float scale;
1809
    float scale;
1806
    float largeopFactor = kLargeOpFactor;
1810
    float largeopFactor = kLargeOpFactor;
1807
1811
1808
    // increase the width if it is not largeopFactor times larger
1812
    // increase the width if it is not largeopFactor times larger
1809
    // than the initial one.
1813
    // than the initial one.
1810
    if ((aDesiredStretchSize.rightBearing - aDesiredStretchSize.leftBearing) <
1814
    if ((aDesiredStretchSize.rightBearing - aDesiredStretchSize.leftBearing) <
1811
        largeopFactor * (initialSize.rightBearing - initialSize.leftBearing)) {
1815
        largeopFactor * (initialSize.rightBearing - initialSize.leftBearing)) {
1812
      scale = (largeopFactor *
1816
      scale = (largeopFactor *

Return to bug 960115