4 #include "math_frameboxinset.h"
5 #include "math_support.h"
6 #include "math_mathmlstream.h"
7 #include "math_streamstr.h"
8 #include "frontends/Painter.h"
12 MathFrameboxInset::MathFrameboxInset()
17 MathInset * MathFrameboxInset::clone() const
19 return new MathFrameboxInset(*this);
23 void MathFrameboxInset::metrics(MathMetricsInfo & mi) const
25 w_ = mathed_char_width(mi.base.font, '[');
26 MathNestInset::metrics(mi);
28 dim_ += cell(1).dim();
30 metricsMarkers2(5); // 5 pixels margin
34 void MathFrameboxInset::draw(MathPainterInfo & pi, int x, int y) const
36 pi.pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2,
39 drawStrBlack(pi, x, y, "[");
41 cell(0).draw(pi, x, y);
43 drawStrBlack(pi, x, y, "]");
45 cell(1).draw(pi, x, y);
49 void MathFrameboxInset::write(WriteStream & os) const
53 os << '[' << cell(0) << ']';
54 os << '{' << cell(1) << '}';
58 void MathFrameboxInset::normalize(NormalStream & os) const
60 os << "[framebox " << cell(0) << ' ' << cell(1) << ']';