X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathRoot.cpp;h=8c4d1fa5ac784b94403c964b20bb729ee0014d74;hb=02e82157ec583c3900e359de86be79fac6512387;hp=4a78ab997521ba92cd2d3a719136cd9958be947b;hpb=9b3aadbe22be57f9473011d2c3f1842186bc03e9;p=lyx.git diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index 4a78ab9975..8c4d1fa5ac 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -13,13 +13,16 @@ #include "InsetMathRoot.h" -#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" + #include "Cursor.h" +#include "LaTeXFeatures.h" +#include "MetricsInfo.h" #include "frontends/Painter.h" + using namespace std; namespace lyx { @@ -38,18 +41,20 @@ Inset * InsetMathRoot::clone() const void InsetMathRoot::metrics(MetricsInfo & mi, Dimension & dim) const { + Changer dummy = mi.base.changeEnsureMath(); InsetMathNest::metrics(mi); Dimension const & dim0 = cell(0).dimension(*mi.base.bv); Dimension const & dim1 = cell(1).dimension(*mi.base.bv); dim.asc = max(dim0.ascent() + 5, dim1.ascent()) + 2; dim.des = max(dim0.descent() - 5, dim1.descent()) + 2; dim.wid = dim0.width() + dim1.width() + 10; - metricsMarkers(dim); + metricsMarkers(mi, dim); } void InsetMathRoot::draw(PainterInfo & pi, int x, int y) const { + Changer dummy = pi.base.changeEnsureMath(); Dimension const & dim0 = cell(0).dimension(*pi.base.bv); int const w = dim0.width(); // the "exponent" @@ -133,10 +138,9 @@ void InsetMathRoot::htmlize(HtmlStream & os) const void InsetMathRoot::validate(LaTeXFeatures & features) const { if (features.runparams().math_flavor == OutputParams::MathAsHTML) - features.addPreambleSnippet(""); + "span.root sup{font-size: 75%;}"); InsetMathNest::validate(features); }