2001-09-11 10:58:17 +00:00
|
|
|
#include <config.h>
|
|
|
|
#include "debug.h"
|
|
|
|
#include "support/LOstream.h"
|
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "math_scriptinset.h"
|
|
|
|
|
|
|
|
|
2001-09-11 10:58:17 +00:00
|
|
|
MathScriptInset::MathScriptInset(bool up)
|
|
|
|
: MathNestInset(1), up_(up)
|
2001-06-25 00:06:33 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
2001-06-28 10:25:20 +00:00
|
|
|
MathInset * MathScriptInset::clone() const
|
2001-06-25 00:06:33 +00:00
|
|
|
{
|
2001-09-11 10:58:17 +00:00
|
|
|
return new MathScriptInset(*this);
|
2001-07-26 06:46:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-09-11 10:58:17 +00:00
|
|
|
void MathScriptInset::write(std::ostream & os, bool fragile) const
|
2001-07-26 06:46:50 +00:00
|
|
|
{
|
2001-09-11 10:58:17 +00:00
|
|
|
cell(0).write(os, fragile);
|
2001-07-26 06:46:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-06 17:20:26 +00:00
|
|
|
void MathScriptInset::metrics(MathStyles st) const
|
2001-07-26 06:46:50 +00:00
|
|
|
{
|
2001-09-11 10:58:17 +00:00
|
|
|
size_ = st;
|
|
|
|
xcell(0).metrics(st);
|
|
|
|
width_ = xcell(0).width();
|
|
|
|
ascent_ = xcell(0).ascent();
|
|
|
|
descent_ = xcell(0).descent();
|
2001-09-11 14:15:30 +00:00
|
|
|
//lyxerr << "MathScriptInset::metrics: w: " << width_ << " a: " << ascent_
|
|
|
|
// << " d: " << descent_ << "\n";
|
2001-07-26 06:46:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-08-06 17:20:26 +00:00
|
|
|
void MathScriptInset::draw(Painter & pain, int x, int y) const
|
2001-09-11 10:58:17 +00:00
|
|
|
{
|
2001-07-26 06:46:50 +00:00
|
|
|
xo(x);
|
|
|
|
yo(y);
|
2001-09-11 10:58:17 +00:00
|
|
|
xcell(0).draw(pain, x, y);
|
2001-07-26 06:46:50 +00:00
|
|
|
}
|