]> git.lyx.org Git - features.git/blobdiff - src/mathed/InsetMathScript.cpp
* kerning may depend on the BufferView because the metrics of some insets (e.g. math...
[features.git] / src / mathed / InsetMathScript.cpp
index a6d81617d7e64a4e011d557653ed5dfc0353ec95..a8142612cd31c96f9d0ae578f076e0ddae26820e 100644 (file)
@@ -253,7 +253,7 @@ int InsetMathScript::dx1(BufferView const & bv) const
 {
        BOOST_ASSERT(hasUp());
        Dimension const dim = dimension(bv);
-       return hasLimits() ? (dim.wid - up().dimension(bv).width()) / 2 : nwid(bv) + nker();
+       return hasLimits() ? (dim.wid - up().dimension(bv).width()) / 2 : nwid(bv) + nker(&bv);
 }
 
 
@@ -282,10 +282,10 @@ int InsetMathScript::ndes(BufferView const & bv) const
 }
 
 
-int InsetMathScript::nker() const
+int InsetMathScript::nker(BufferView const * bv) const
 {
        if (nuc().size()) {
-               int kerning = nuc().kerning();
+               int kerning = nuc().kerning(bv);
                return kerning > 0 ? kerning : 0;
        }
        return 0;
@@ -322,7 +322,7 @@ void InsetMathScript::metrics(MetricsInfo & mi, Dimension & dim) const
                        dim.wid = max(dim.wid, dimdown.width());
        } else {
                if (hasUp())
-                       dim.wid = max(dim.wid, nker() + dimup.width());
+                       dim.wid = max(dim.wid, nker(mi.base.bv) + dimup.width());
                if (hasDown())
                        dim.wid = max(dim.wid, dimdown.width());
                dim.wid += nwid(bv);