mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
using previews might be a good alternative to hard coding such diagrams...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4595 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
32e55ec7c8
commit
6504da095b
@ -17,7 +17,7 @@ MathMetricsBase::MathMetricsBase()
|
||||
|
||||
|
||||
MathMetricsInfo::MathMetricsInfo()
|
||||
: view(0), inset(0), idx(0), fullredraw(false)
|
||||
: view(0), fullredraw(false)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -47,10 +47,6 @@ struct MathMetricsInfo {
|
||||
MathMetricsBase base;
|
||||
///
|
||||
BufferView * view;
|
||||
/// used to pass some info down
|
||||
MathNestInset const * inset;
|
||||
///
|
||||
int idx;
|
||||
///
|
||||
bool fullredraw;
|
||||
};
|
||||
|
@ -58,11 +58,8 @@ void MathNestInset::substitute(MathMacro const & m)
|
||||
void MathNestInset::metrics(MathMetricsInfo const & mi) const
|
||||
{
|
||||
MathMetricsInfo m = mi;
|
||||
m.inset = this;
|
||||
for (idx_type i = 0; i < nargs(); ++i) {
|
||||
m.idx = i;
|
||||
for (idx_type i = 0; i < nargs(); ++i)
|
||||
xcell(i).metrics(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -35,6 +35,7 @@ MathXYMatrixInset const * MathXYArrowInset::targetMatrix() const
|
||||
|
||||
MathXArray const & MathXYArrowInset::targetCell() const
|
||||
{
|
||||
#if 0
|
||||
MathXYMatrixInset const * p = targetMatrix();
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
@ -55,12 +56,21 @@ MathXArray const & MathXYArrowInset::targetCell() const
|
||||
n = 0;
|
||||
}
|
||||
return p->xcell(n);
|
||||
#else
|
||||
static MathXArray dummy;
|
||||
return dummy;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
MathXArray const & MathXYArrowInset::sourceCell() const
|
||||
{
|
||||
#if 0
|
||||
return targetMatrix()->xcell(mi_.idx);
|
||||
#else
|
||||
static MathXArray dummy;
|
||||
return dummy;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -69,6 +79,7 @@ void MathXYArrowInset::metrics(MathMetricsInfo & mi) const
|
||||
MathNestInset::metrics(mi);
|
||||
mi_ = mi;
|
||||
MathFontSetChanger dummy(mi.base, "textrm");
|
||||
#if 0
|
||||
target_ = mi.inset ? mi.inset->asXYMatrixInset() : 0;
|
||||
|
||||
if (editing()) {
|
||||
@ -82,6 +93,7 @@ void MathXYArrowInset::metrics(MathMetricsInfo & mi) const
|
||||
descent_ = 0;
|
||||
//mathed_string_dim(font_, "X", ascent_, descent_, width_);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -92,6 +104,8 @@ void MathXYArrowInset::draw(MathPainterInfo & pi, int x, int y) const
|
||||
|
||||
if (editing()) {
|
||||
|
||||
#if 0
|
||||
|
||||
int lasc;
|
||||
int ldes;
|
||||
int lwid;
|
||||
@ -105,9 +119,11 @@ void MathXYArrowInset::draw(MathPainterInfo & pi, int x, int y) const
|
||||
xcell(1).draw(pi, x + lwid, y);
|
||||
drawStr(pi, pi.base.font, x + 3, y, "label");
|
||||
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
//drawStr(pi, font_, x, y, "X");
|
||||
drawStr(pi, font_, x, y, "X");
|
||||
MathXArray const & s = sourceCell();
|
||||
MathXArray const & t = targetCell();
|
||||
pi.pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);
|
||||
|
Loading…
Reference in New Issue
Block a user