From 6504da095b61f521a2aa89202d12590774bce3b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 10 Jul 2002 15:51:28 +0000 Subject: [PATCH] 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 --- src/mathed/math_metricsinfo.C | 2 +- src/mathed/math_metricsinfo.h | 4 ---- src/mathed/math_nestinset.C | 5 +---- src/mathed/math_xyarrowinset.C | 18 +++++++++++++++++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/mathed/math_metricsinfo.C b/src/mathed/math_metricsinfo.C index 118d5aaf48..5bb81e2341 100644 --- a/src/mathed/math_metricsinfo.C +++ b/src/mathed/math_metricsinfo.C @@ -17,7 +17,7 @@ MathMetricsBase::MathMetricsBase() MathMetricsInfo::MathMetricsInfo() - : view(0), inset(0), idx(0), fullredraw(false) + : view(0), fullredraw(false) {} diff --git a/src/mathed/math_metricsinfo.h b/src/mathed/math_metricsinfo.h index 8cb8422fd5..f4d6ab6275 100644 --- a/src/mathed/math_metricsinfo.h +++ b/src/mathed/math_metricsinfo.h @@ -47,10 +47,6 @@ struct MathMetricsInfo { MathMetricsBase base; /// BufferView * view; - /// used to pass some info down - MathNestInset const * inset; - /// - int idx; /// bool fullredraw; }; diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 2358c582d3..91f11b36c9 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -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); - } } diff --git a/src/mathed/math_xyarrowinset.C b/src/mathed/math_xyarrowinset.C index fe5a886297..c0bef38802 100644 --- a/src/mathed/math_xyarrowinset.C +++ b/src/mathed/math_xyarrowinset.C @@ -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); -- 2.39.2