using std::ostream;
MathBigopInset::MathBigopInset(string const & name, int id)
- : MathUpDownInset(false, false), sym_(id), limits_(0)
+ : sym_(id)
{
SetName(name);
}
}
-int MathBigopInset::limits() const
-{
- return limits_;
-}
-
-
-void MathBigopInset::limits(int limits)
-{
- limits_ = limits;
-}
-
-
-bool MathBigopInset::hasLimits() const
-{
- return limits_ == 1 || (limits_ == 0 && size() == LM_ST_DISPLAY);
-}
-
-
-void MathBigopInset::Write(ostream & os, bool fragile) const
+void MathBigopInset::Write(ostream & os, bool /* fragile */) const
{
//bool f = sym_ != LM_int && sym_ != LM_oint && size() == LM_ST_DISPLAY;
os << '\\' << name();
- MathUpDownInset::Write(os, fragile);
}
}
-void MathBigopInset::Metrics(MathStyles st, int, int)
+void MathBigopInset::Metrics(MathStyles st)
{
//cerr << "\nBigopDraw\n";
size(st);
code_ = LM_TC_TEXTRM;
}
- int wid;
- mathed_string_dim(code_, size(), ssym_, ascent_, descent_, wid);
+ mathed_string_dim(code_, size(), ssym_, ascent_, descent_, width_);
if (sym_ == LM_oint)
- wid += 2;
- //cerr << " asc: " << ascent_ << " des: " << descent_
- // << " wid: " << wid << "\n";
- //cerr << " hasLimits: " << hasLimits() << " up: "
- // << up() << " down: " << down() << "\n";
-
- width_ = wid;
-
- if (hasLimits()) {
- xcell(0).Metrics(st);
- xcell(1).Metrics(st);
- //cerr << " 0: ascent_: " << xcell(0).ascent() << " descent_: " <<
- // xcell(0).descent() << " width_: " << xcell(0).width() << "\n";
- //cerr << " 1: ascent_: " << xcell(1).ascent() << " descent_: " <<
- // xcell(1).descent() << " width_: " << xcell(1).width() << "\n";
- if (up()) {
- ascent_ += xcell(0).height() + 1;
- width_ = std::max(width_, xcell(0).width());
- dy0_ = - (ascent_ - xcell(0).ascent());
- }
- if (down()) {
- descent_ += xcell(1).height() + 1;
- width_ = std::max(width_, xcell(1).width());
- dy1_ = descent_ - xcell(1).descent();
- }
- dxx_ = (width_ - wid) / 2;
- dx0_ = (width_ - xcell(0).width()) / 2;
- dx1_ = (width_ - xcell(1).width()) / 2;
- //cerr << " ascent_: " << ascent_ << " descent_: "
- // << descent_ << " width_: " << width_ << "\n";
- //cerr << " dx0_: " << dx0_ << " dx1_: " << dx1_
- // << " dxx_: " << dxx_ << "\n";
- //cerr << " dy0_: " << dy0_ << " dy1_: " << dy1_
- // << "\n";
- } else {
- MathUpDownInset::Metrics(st, ascent_, descent_);
- width_ += wid;
- dx0_ = wid;
- dx1_ = wid;
- dxx_ = 0;
- }
+ width_ += 2;
}
xo(x);
yo(y);
- drawStr(pain, code_, size_, x + dxx_, y, ssym_);
-
- if (up())
- xcell(0).draw(pain, x + dx0_, y + dy0_);
- if (down())
- xcell(1).draw(pain, x + dx1_, y + dy1_);
+ drawStr(pain, code_, size_, x, y, ssym_);
if (sym_ == LM_oint) {
int xx = x - 1;
pain.arc(xx, yy, width_, width_, 0, 360 * 64, LColor::mathline);
}
}
-
-