]> git.lyx.org Git - lyx.git/commitdiff
using previews might be a good alternative to hard coding such diagrams...
authorAndré Pönitz <poenitz@gmx.net>
Wed, 10 Jul 2002 15:51:28 +0000 (15:51 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Wed, 10 Jul 2002 15:51:28 +0000 (15:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4595 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_metricsinfo.C
src/mathed/math_metricsinfo.h
src/mathed/math_nestinset.C
src/mathed/math_xyarrowinset.C

index 118d5aaf486a8e27f0167fc3c1de0594ac1f32b5..5bb81e2341ee09cddd5b32e94f704fb699d554d9 100644 (file)
@@ -17,7 +17,7 @@ MathMetricsBase::MathMetricsBase()
 
 
 MathMetricsInfo::MathMetricsInfo()
-       : view(0), inset(0), idx(0), fullredraw(false)
+       : view(0), fullredraw(false)
 {}
 
 
index 8cb8422fd51e2ffe1a575ebf8a17e0dd0ea60afa..f4d6ab6275d06a309d7e5548ad891935ff11058d 100644 (file)
@@ -47,10 +47,6 @@ struct MathMetricsInfo {
        MathMetricsBase base;
        ///
        BufferView * view;
-       /// used to pass some info down
-       MathNestInset const * inset;
-       ///
-       int idx;
        ///
        bool fullredraw;
 };
index 2358c582d319d3af7205815cd74e0a2e8de0021b..91f11b36c9995f7725870a25fdc1e1266575177f 100644 (file)
@@ -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);
-       }
 }
 
 
index fe5a886297550599033f1b3e6f52da1994e29264..c0bef3880278d0eb9e5d789f4d0de0a36f36f878 100644 (file)
@@ -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);