2002-03-19 16:55:58 +00:00
|
|
|
#include "math_diminset.h"
|
|
|
|
#include "Lsstream.h"
|
|
|
|
#include "textpainter.h"
|
|
|
|
|
|
|
|
|
2002-07-08 16:20:53 +00:00
|
|
|
void MathDimInset::dimensions(int & w, int & a, int & d) const
|
|
|
|
{
|
|
|
|
w = width_;
|
|
|
|
a = ascent_;
|
|
|
|
d = descent_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-03-21 06:57:13 +00:00
|
|
|
void MathDimInset::metricsT(TextMetricsInfo const &) const
|
2002-03-19 16:55:58 +00:00
|
|
|
{
|
|
|
|
std::ostringstream os;
|
|
|
|
os << *this;
|
|
|
|
width_ = int(os.str().size());
|
|
|
|
ascent_ = 1;
|
|
|
|
descent_ = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-03-21 06:57:13 +00:00
|
|
|
void MathDimInset::drawT(TextPainter & pain, int x, int y) const
|
2002-03-19 16:55:58 +00:00
|
|
|
{
|
|
|
|
std::ostringstream os;
|
|
|
|
os << *this;
|
|
|
|
pain.draw(x, y, os.str().c_str());
|
|
|
|
}
|