crude support for a few more AMS constructs

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4280 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-05-29 15:58:26 +00:00
parent 9af069e928
commit 6a0b1fe001
3 changed files with 24 additions and 10 deletions

View File

@ -26,22 +26,26 @@ void MathDotsInset::metrics(MathMetricsInfo const & mi) const
LyXFont font;
whichFont(font, LM_TC_VAR, mi);
mathed_char_dim(font, 'M', ascent_, descent_, width_);
switch (name_[0]) {
case 'l': dh_ = 0; break;
case 'c': dh_ = ascent_ / 2; break;
case 'v': width_ /= 2;
case 'd': dh_ = ascent_; break;
}
if (name_ == "ldots" || name_ == "dotsm")
dh_ = 0;
else if (name_ == "cdots" || name_ == "dotsb"
|| name_ == "dotsm" || name_ == "dotsi")
dh_ = ascent_ / 2;
else if (name_ == "dotsc")
dh_ = ascent_ / 4;
else if (name_ == "vdots")
width_ /= 2;
else if (name_ == "ddots")
dh_ = ascent_;
}
void MathDotsInset::draw(Painter & pain, int x, int y) const
{
mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
char const c = name_[0];
if (c == 'v' || c == 'd')
if (name_ == "vdots" || name_ == "ddots")
++x;
if (c != 'v')
if (name_ != "vdots")
--y;
mathed_draw_deco(pain, x + 2, y - dh_, width_ - 2, ascent_, name_);
}

View File

@ -68,6 +68,11 @@ key_type wordlist_array[] =
{"ddot", LM_TK_DECORATION, 0},
{"dddot", LM_TK_DECORATION, 0},
{"ddots", LM_TK_DOTS, 0},
{"dotsb", LM_TK_DOTS, 0},
{"dotsc", LM_TK_DOTS, 0},
{"dotsi", LM_TK_DOTS, 0},
{"dotsm", LM_TK_DOTS, 0},
{"dotso", LM_TK_DOTS, 0},
{"deg", LM_TK_FUNC, 0},
{"det", LM_TK_FUNCLIM, 0},
{"dim", LM_TK_FUNC, 0},

View File

@ -524,7 +524,12 @@ named_deco_struct deco_table[] = {
{"ldots", hline3, 0 },
{"cdots", hline3, 0 },
{"vdots", hline3, 1 },
{"ddots", dline3, 0 }
{"ddots", dline3, 0 },
{"dotsb", hline3, 0 },
{"dotsc", hline3, 0 },
{"dotsi", hline3, 0 },
{"dotsm", hline3, 0 },
{"dotso", hline3, 0 }
};