]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_binominset.C
several smallish changes/bugfixes/left overs from Porto
[lyx.git] / src / mathed / math_binominset.C
index 35d1e7dbc9569e5ab52da2e26a3442534325c12b..cfdb835ca000c0dd9baaacba1e0777ae5042036b 100644 (file)
 #include "math_mathmlstream.h"
 
 
+using std::max;
+
+
 MathBinomInset::MathBinomInset()
 {}
 
 
 MathInset * MathBinomInset::clone() const
-{   
+{
        return new MathBinomInset(*this);
 }
 
@@ -31,25 +34,25 @@ int MathBinomInset::dw() const
 }
 
 
-void MathBinomInset::metrics(MathMetricsInfo const & st) const
+void MathBinomInset::metrics(MathMetricsInfo & mi) const
 {
-       MathMetricsInfo mi = st;
-       smallerStyleFrac(mi);
+       MathScriptChanger(mi.base);
        xcell(0).metrics(mi);
        xcell(1).metrics(mi);
        ascent_  = xcell(0).height() + 4 + 5;
-       descent_ = xcell(1).height() + 4 - 5; 
-       width_   = std::max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4; 
+       descent_ = xcell(1).height() + 4 - 5;
+       width_   = max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4;
 }
 
 
-void MathBinomInset::draw(Painter & pain, int x, int y) const
+void MathBinomInset::draw(MathPainterInfo & pi, int x, int y) const
 {
        int m = x + width() / 2;
-       xcell(0).draw(pain, m - xcell(0).width() / 2, y - xcell(0).descent() - 3 - 5);
-       xcell(1).draw(pain, m - xcell(1).width() / 2, y + xcell(1).ascent()  + 3 - 5);
-       mathed_draw_deco(pain, x, y - ascent_, dw(), height(), "(");
-       mathed_draw_deco(pain, x + width() - dw(), y - ascent_, dw(), height(), ")");
+       MathScriptChanger(pi.base);
+       xcell(0).draw(pi, m - xcell(0).width() / 2, y - xcell(0).descent() - 3 - 5);
+       xcell(1).draw(pi, m - xcell(1).width() / 2, y + xcell(1).ascent()  + 3 - 5);
+       mathed_draw_deco(pi, x, y - ascent_, dw(), height(), "(");
+       mathed_draw_deco(pi, x + width() - dw(), y - ascent_,   dw(), height(), ")");
 }