Fix corner markers in amsarray, cases

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9775 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2005-04-04 07:13:37 +00:00
parent e6bdf56c97
commit 5e98ec6251
5 changed files with 24 additions and 6 deletions

View File

@ -1,3 +1,11 @@
2005-04-04 Martin Vermeer <martin.vermeer@hut.fi>
* math_amsarrayinset.C:
* math_casesinset.C:
* math_gridinset.C:
* math_gridinset.h: Add drawWithMargin method for use by
AMSArray and Cases, to position corner markers right
2005-03-31 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* math_amsarrayinset.[Ch], math_tabularinset.[Ch],

View File

@ -91,7 +91,7 @@ void MathAMSArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const
void MathAMSArrayInset::draw(PainterInfo & pi, int x, int y) const
{
MathGridInset::draw(pi, x + 6, y);
MathGridInset::drawWithMargin(pi, x, y, 6, 6);
int const yy = y - dim_.ascent();
mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), name_left());
mathed_draw_deco(pi, x + dim_.width() - 6, yy, 5, dim_.height(), name_right());

View File

@ -58,7 +58,7 @@ void MathCasesInset::metrics(MetricsInfo & mi, Dimension & dim) const
void MathCasesInset::draw(PainterInfo & pi, int x, int y) const
{
mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 6, dim_.height(), "{");
MathGridInset::draw(pi, x + 8, y);
MathGridInset::drawWithMargin(pi, x, y, 8, 0);
setPosCache(pi, x, y);
}

View File

@ -478,22 +478,29 @@ void MathGridInset::metrics(MetricsInfo & mi, Dimension & dim) const
void MathGridInset::draw(PainterInfo & pi, int x, int y) const
{
drawWithMargin(pi, x, y, 0, 0);
}
void MathGridInset::drawWithMargin(PainterInfo & pi, int x, int y,
int lmargin, int rmargin) const
{
for (idx_type idx = 0; idx < nargs(); ++idx)
cell(idx).draw(pi, x + cellXOffset(idx), y + cellYOffset(idx));
cell(idx).draw(pi, x + lmargin + cellXOffset(idx),
y + cellYOffset(idx));
for (row_type row = 0; row <= nrows(); ++row)
for (unsigned int i = 0; i < rowinfo_[row].lines_; ++i) {
int yy = y + rowinfo_[row].offset_ - rowinfo_[row].ascent_
- i * hlinesep() - hlinesep()/2 - rowsep()/2;
pi.pain.line(x + 1, yy,
x + dim_.width() - 1, yy,
pi.pain.line(x + lmargin + 1, yy,
x + dim_.width() - rmargin - 1, yy,
LColor::foreground);
}
for (col_type col = 0; col <= ncols(); ++col)
for (unsigned int i = 0; i < colinfo_[col].lines_; ++i) {
int xx = x + colinfo_[col].offset_
int xx = x + lmargin + colinfo_[col].offset_
- i * vlinesep() - vlinesep()/2 - colsep()/2;
pi.pain.line(xx, y - dim_.ascent() + 1,
xx, y + dim_.descent() - 1,

View File

@ -98,6 +98,9 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const;
///
void drawWithMargin(PainterInfo & pi, int x, int y,
int lmargin = 0, int rmargin = 0) const;
///
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
///
void drawT(TextPainter & pi, int x, int y) const;