From: Jean-Marc Lasgouttes Date: Sun, 14 Jul 2019 12:42:37 +0000 (+0200) Subject: Replace MathData::kerning_ member by a function X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=3bba2fb8d45f8a60ddcea52947a387115a5a6a17;p=features.git 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. --- diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index 0676dc732a..9bfd558fe2 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 b118d6c41f..810223d5be 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: