commit 4cc4663262f2c806ed9e44d5a24ca6fd0136da76
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Sun Jul 14 14:42:37 2019 +0200

    Replace MathData::kerning_ member by a function
    
    This allows to make kerning depend on the BufferView? This is not
    useful right now, but may become useful for multimonotor setting with
    different dpi.
---
 src/mathed/MathData.cpp |    9 +++++++--
 src/mathed/MathData.h   |    5 ++---
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index 0676dc7..9bfd558 100644
--- a/src/mathed/MathData.cpp
+++ b/src/mathed/MathData.cpp
@@ -48,7 +48,7 @@ namespace lyx {
 
 MathData::MathData(Buffer * buf, const_iterator from, const_iterator to)
        : base_type(from, to), minasc_(0), mindes_(0), slevel_(0),
-         sshift_(0), kerning_(0), buffer_(buf)
+         sshift_(0), buffer_(buf)
 {}
 
 
@@ -282,7 +282,6 @@ void MathData::metrics(MetricsInfo & mi, Dimension & dim, 
bool tight) const
 
        MathRow mrow(mi, this);
        mrow.metrics(mi, dim);
-       kerning_ = mrow.kerning(bv);
 
        // Set a minimal ascent/descent for the cell
        if (tight)
@@ -381,6 +380,12 @@ void MathData::drawT(TextPainter & pain, int x, int y) 
const
 }
 
 
+int MathData::kerning(BufferView const * bv) const
+{
+       return  bv->mathRow(this).kerning(bv);
+}
+
+
 void MathData::updateBuffer(ParIterator const & it, UpdateType utype)
 {
        // pass down
diff --git a/src/mathed/MathData.h b/src/mathed/MathData.h
index b118d6c..810223d 100644
--- a/src/mathed/MathData.h
+++ b/src/mathed/MathData.h
@@ -69,7 +69,7 @@ public:
 public:
        ///
        MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
-                                    sshift_(0), kerning_(0), buffer_(buf) {}
+                                    sshift_(0), buffer_(buf) {}
        ///
        MathData(Buffer * buf, const_iterator from, const_iterator to);
        ///
@@ -170,7 +170,7 @@ public:
        /// additional super/subscript shift
        int sshift() const { return sshift_; }
        /// Italic correction as described in InsetMathScript.h
-       int kerning(BufferView const *) const { return kerning_; }
+       int kerning(BufferView const *) const;
        ///
        void swap(MathData & ar) { base_type::swap(ar); }
 
@@ -188,7 +188,6 @@ protected:
        mutable int mindes_;
        mutable int slevel_;
        mutable int sshift_;
-       mutable int kerning_;
        Buffer * buffer_;
 
 private:

Reply via email to