Final touches, corner markers & clickability in math

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9778 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2005-04-04 22:11:53 +00:00
parent 5f27947aef
commit e9ac548c9a
7 changed files with 24 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2005-04-05 Martin Vermeer <martin.vermeer@hut.fi>
* math_amsarrayinset.C:
* math__arrayinset.C:
* math_decorationinset.C:
* math_deliminset.C:
* math_nestinset.C:
* math_tabularinset.C: Final touch on various corner marker
positions and inset clickability in math
2005-04-04 Martin Vermeer <martin.vermeer@hut.fi> 2005-04-04 Martin Vermeer <martin.vermeer@hut.fi>
* math_splitinset.[Ch]: add draw method calling setPosCache, * math_splitinset.[Ch]: add draw method calling setPosCache,

View File

@ -84,17 +84,17 @@ void MathAMSArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const
if (m.base.style == LM_ST_DISPLAY) if (m.base.style == LM_ST_DISPLAY)
m.base.style = LM_ST_TEXT; m.base.style = LM_ST_TEXT;
MathGridInset::metrics(m, dim); MathGridInset::metrics(m, dim);
dim.wid += 12; dim.wid += 14;
dim_ = dim; dim_ = dim;
} }
void MathAMSArrayInset::draw(PainterInfo & pi, int x, int y) const void MathAMSArrayInset::draw(PainterInfo & pi, int x, int y) const
{ {
MathGridInset::drawWithMargin(pi, x, y, 6, 6); MathGridInset::drawWithMargin(pi, x, y, 6, 8);
int const yy = y - dim_.ascent(); int const yy = y - dim_.ascent();
mathed_draw_deco(pi, x + 1, yy, 5, dim_.height(), name_left()); 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()); mathed_draw_deco(pi, x + dim_.width() - 8, yy, 5, dim_.height(), name_right());
setPosCache(pi, x, y); setPosCache(pi, x, y);
} }

View File

@ -82,6 +82,8 @@ void MathArrayInset::metrics(MetricsInfo & mi, Dimension & dim) const
{ {
ArrayChanger dummy(mi.base); ArrayChanger dummy(mi.base);
MathGridInset::metrics(mi, dim); MathGridInset::metrics(mi, dim);
dim.wid += 6;
dim_ = dim;
} }
@ -89,7 +91,7 @@ void MathArrayInset::draw(PainterInfo & pi, int x, int y) const
{ {
setPosCache(pi, x, y); setPosCache(pi, x, y);
ArrayChanger dummy(pi.base); ArrayChanger dummy(pi.base);
MathGridInset::draw(pi, x + 1, y); MathGridInset::drawWithMargin(pi, x, y, 4, 2);
} }

View File

@ -128,6 +128,7 @@ void MathDecorationInset::draw(PainterInfo & pi, int x, int y) const
mathed_draw_deco(pi, x + 1 + (cell(0).width() - dw_) / 2, mathed_draw_deco(pi, x + 1 + (cell(0).width() - dw_) / 2,
y + dy_, dw_, dh_, key_->name); y + dy_, dw_, dh_, key_->name);
drawMarkers(pi, x, y); drawMarkers(pi, x, y);
setPosCache(pi, x, y);
} }

View File

@ -111,6 +111,7 @@ void MathDelimInset::draw(PainterInfo & pi, int x, int y) const
mathed_draw_deco(pi, x + 4, b, dw_, dim_.height(), left_); mathed_draw_deco(pi, x + 4, b, dw_, dim_.height(), left_);
mathed_draw_deco(pi, x + dim_.width() - dw_ - 4, mathed_draw_deco(pi, x + dim_.width() - dw_ - 4,
b, dw_, dim_.height(), right_); b, dw_, dim_.height(), right_);
setPosCache(pi, x, y);
} }

View File

@ -128,6 +128,7 @@ void MathNestInset::getCursorPos(CursorSlice const & sl,
x += 2; x += 2;
} }
void MathNestInset::metrics(MetricsInfo const & mi) const void MathNestInset::metrics(MetricsInfo const & mi) const
{ {
MetricsInfo m = mi; MetricsInfo m = mi;

View File

@ -48,17 +48,19 @@ auto_ptr<InsetBase> MathTabularInset::doClone() const
} }
void MathTabularInset::metrics(MetricsInfo & mi, Dimension & /*dim*/) const void MathTabularInset::metrics(MetricsInfo & mi, Dimension & dim) const
{ {
FontSetChanger dummy(mi.base, "textnormal"); FontSetChanger dummy(mi.base, "textnormal");
return MathGridInset::metrics(mi); MathGridInset::metrics(mi, dim);
dim.wid += 6;
dim_ = dim;
} }
void MathTabularInset::draw(PainterInfo & pi, int x, int y) const void MathTabularInset::draw(PainterInfo & pi, int x, int y) const
{ {
FontSetChanger dummy(pi.base, "textnormal"); FontSetChanger dummy(pi.base, "textnormal");
MathGridInset::draw(pi, x, y); MathGridInset::drawWithMargin(pi, x, y, 4, 2);
} }