]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSqrt.cpp
Fix some spelling errors reported by Sven
[lyx.git] / src / mathed / InsetMathSqrt.cpp
index 4505d705671056901cb8faf8fed407edc1d03ada..a7385cc708ccd9b30443c7b03e1554935d931e6f 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "MathData.h"
 #include "MathStream.h"
+#include "MathSupport.h"
 
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
@@ -39,9 +40,13 @@ void InsetMathSqrt::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        Changer dummy = mi.base.changeEnsureMath();
        cell(0).metrics(mi, dim);
-       dim.asc += 4;
-       dim.des += 2;
-       dim.wid += 12;
+       // make sure that the dim is high enough for any character
+       Dimension fontDim;
+       math_font_max_dim(mi.base.font, fontDim.asc, fontDim.des);
+       dim += fontDim;
+       // Some room for the decoration
+       dim.asc += 1;
+       dim.wid += 7;
 }
 
 
@@ -121,8 +126,8 @@ void InsetMathSqrt::mathmlize(MathStream & os) const
 void InsetMathSqrt::htmlize(HtmlStream & os) const
 {
        os << MTag("span", "class='sqrt'")
-          << from_ascii("&radic;") 
-          << MTag("span", "class='sqrtof'")    << cell(0) << ETag("span") 
+          << from_ascii("&radic;")
+          << MTag("span", "class='sqrtof'")    << cell(0) << ETag("span")
                 << ETag("span");
 }