]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_sizeinset.C
make \newcommand{\bb}[1]{\mathbf{#1}} work for read/write/display.
[lyx.git] / src / mathed / math_sizeinset.C
index 86edc28163e9fb01c0da549a52950121aa5bfefc..0f4eb4667aa4e1dce1d685e410894a59eddec411 100644 (file)
@@ -1,3 +1,5 @@
+#include <config.h>
+
 #ifdef __GNUG__
 #pragma implementation
 #endif
@@ -5,6 +7,8 @@
 #include "math_sizeinset.h"
 #include "math_parser.h"
 #include "math_mathmlstream.h"
+#include "math_streamstr.h"
+#include "math_support.h"
 
 
 MathSizeInset::MathSizeInset(latexkeys const * l)
@@ -20,7 +24,8 @@ MathInset * MathSizeInset::clone() const
 
 void MathSizeInset::draw(Painter & pain, int x, int y) const
 {
-       xcell(0).draw(pain, x, y);
+       xcell(0).draw(pain, x + 1, y);
+       mathed_draw_framebox(pain, x, y, this);
 }
 
 
@@ -29,19 +34,19 @@ void MathSizeInset::metrics(MathMetricsInfo const & mi) const
        MathMetricsInfo m = mi;
        m.style = MathStyles(key_->id);
        xcell(0).metrics(m);
-       ascent_   = xcell(0).ascent_;
-       descent_  = xcell(0).descent_;
-       width_    = xcell(0).width_;
+       ascent_   = xcell(0).ascent_ + 1;
+       descent_  = xcell(0).descent_ + 1;
+       width_    = xcell(0).width_ + 2;
 }
 
 
 void MathSizeInset::write(WriteStream & os) const
 {
-       os << "{\\" << key_->name.c_str() << ' ' << cell(0) << '}';
+       os << "{\\" << key_->name << ' ' << cell(0) << '}';
 }
 
 
 void MathSizeInset::normalize(NormalStream & os) const
 {
-       os << "[" << key_->name.c_str() << ' ' << cell(0) << ']';
+       os << "[" << key_->name << ' ' << cell(0) << ']';
 }