]> git.lyx.org Git - features.git/commitdiff
Temporarily fix cursor positioning within mathed.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 23 Sep 2007 16:55:15 +0000 (16:55 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 23 Sep 2007 16:55:15 +0000 (16:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20452 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathChar.cpp
src/mathed/InsetMathChar.h

index 44ba11d3daad2e80799cf4e855c74ce2cfb0bb2e..9349663200618671fa836a71cbf64b69eac8d9fc 100644 (file)
@@ -85,6 +85,9 @@ void InsetMathChar::metrics(MetricsInfo & mi, Dimension & dim) const
                dim.wid += 2 * theFontMetrics(font_).width(' ');
        lyxerr << "InsetMathChar::metrics: " << dim << endl;
 #endif
+       // Cache the inset dimension. 
+       // FIXME: put the resulting dim in BufferView.
+       dim_ = dim;
 }
 
 
index 3a65841c4f8d0538b273030415aec41d5c49382d..c1d5b1974a1608927410608c1795d1e0cb847bc7 100644 (file)
@@ -26,6 +26,8 @@ public:
        ///
        void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
+       Dimension const dimension(BufferView const &) const { return dim_; }
+       ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
        void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
@@ -55,6 +57,8 @@ private:
        char_type char_;
        /// cached kerning for superscript
        mutable int kerning_;
+       /// FIXME: move this out to BufferView
+       mutable Dimension dim_;
 };
 
 } // namespace lyx