X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathKern.cpp;h=f99a210a9d398a76d821424ec3796392959e8c54;hb=d9082639080b9de993742bd352f92e5183058cf5;hp=80e3243ae615b9fb047ee9bc1ebd2b080e534f2f;hpb=66fa801e74e1775b31008df548332436ce79e2e1;p=lyx.git diff --git a/src/mathed/InsetMathKern.cpp b/src/mathed/InsetMathKern.cpp index 80e3243ae6..f99a210a9d 100644 --- a/src/mathed/InsetMathKern.cpp +++ b/src/mathed/InsetMathKern.cpp @@ -11,10 +11,12 @@ #include #include "InsetMathKern.h" -#include "MathStream.h" + #include "MathStream.h" #include "MathSupport.h" + #include "Dimension.h" +#include "MetricsInfo.h" #include "support/docstring.h" @@ -47,7 +49,7 @@ void InsetMathKern::metrics(MetricsInfo & mi, Dimension & dim) const { dim.asc = 0; dim.des = 0; - dim.wid = wid_.inPixels(mi.base); + dim.wid = mi.base.inPixels(wid_); } @@ -55,10 +57,12 @@ void InsetMathKern::draw(PainterInfo &, int, int) const {} -void InsetMathKern::write(WriteStream & os) const +void InsetMathKern::write(TeXMathStream & os) const { if (wid_.empty()) os << "\\kern" << ' '; + else if (wid_.unit() == Length::MU) + os << "\\mkern" << from_utf8(wid_.asLatexString()) << ' '; else os << "\\kern" << from_utf8(wid_.asLatexString()) << ' '; } @@ -73,4 +77,12 @@ void InsetMathKern::normalize(NormalStream & os) const } +void InsetMathKern::infoize2(odocstream & os) const +{ + os << "Kern"; + if (!wid_.empty()) + os << ": " << from_utf8(wid_.asLatexString()); +} + + } // namespace lyx