7 #include "math_frameboxinset.h"
8 #include "math_support.h"
9 #include "math_mathmlstream.h"
10 #include "math_streamstr.h"
11 #include "frontends/Painter.h"
15 MathFrameboxInset::MathFrameboxInset()
20 MathInset * MathFrameboxInset::clone() const
22 return new MathFrameboxInset(*this);
26 void MathFrameboxInset::metrics(MathMetricsInfo & mi) const
28 w_ = mathed_char_width(mi.base.font, '[');
29 MathNestInset::metrics(mi);
31 dim_ += cell(1).dim();
33 metricsMarkers2(5); // 5 pixels margin
37 void MathFrameboxInset::draw(MathPainterInfo & pi, int x, int y) const
39 pi.pain.rectangle(x + 1, y - ascent() + 1, width() - 2, height() - 2,
42 drawStrBlack(pi, x, y, "[");
44 cell(0).draw(pi, x, y);
46 drawStrBlack(pi, x, y, "]");
48 cell(1).draw(pi, x, y);
52 void MathFrameboxInset::write(WriteStream & os) const
56 os << '[' << cell(0) << ']';
57 os << '{' << cell(1) << '}';
61 void MathFrameboxInset::normalize(NormalStream & os) const
63 os << "[framebox " << cell(0) << ' ' << cell(1) << ']';