From 696b5d29b5d5822845eabe42bfc064c4271ade76 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 23 Sep 2007 16:55:15 +0000 Subject: [PATCH] Temporarily fix cursor positioning within mathed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20452 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathChar.cpp | 3 +++ src/mathed/InsetMathChar.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index 44ba11d3da..9349663200 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -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; } diff --git a/src/mathed/InsetMathChar.h b/src/mathed/InsetMathChar.h index 3a65841c4f..c1d5b1974a 100644 --- a/src/mathed/InsetMathChar.h +++ b/src/mathed/InsetMathChar.h @@ -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 -- 2.39.2