virtual bool allowedIn(mode_type mode) const { return mode == MATH_MODE; }
/// superscript kerning
- virtual int kerning() const { return 0; }
+ virtual int kerning(BufferView const * bv) const { return 0; }
};
///
///
void drawT(TextPainter &, int x, int y) const;
///
- int kerning() const { return kerning_; }
+ int kerning(BufferView const * bv) const { return kerning_; }
///
void write(WriteStream & os) const;
///
void infoize(odocstream & os) const;
///
- int kerning() const { return cell(0).kerning(); }
+ int kerning(BufferView const * bv) const { return cell(0).kerning(bv); }
private:
virtual Inset * clone() const;
///
void infoize(odocstream & os) const;
///
- int kerning() const { return cell(0).kerning(); }
+ int kerning(BufferView const * bv) const { return cell(0).kerning(bv); }
private:
virtual Inset * clone() const;
{
BOOST_ASSERT(hasUp());
Dimension const dim = dimension(bv);
- return hasLimits() ? (dim.wid - up().dimension(bv).width()) / 2 : nwid(bv) + nker();
+ return hasLimits() ? (dim.wid - up().dimension(bv).width()) / 2 : nwid(bv) + nker(&bv);
}
}
-int InsetMathScript::nker() const
+int InsetMathScript::nker(BufferView const * bv) const
{
if (nuc().size()) {
- int kerning = nuc().kerning();
+ int kerning = nuc().kerning(bv);
return kerning > 0 ? kerning : 0;
}
return 0;
dim.wid = max(dim.wid, dimdown.width());
} else {
if (hasUp())
- dim.wid = max(dim.wid, nker() + dimup.width());
+ dim.wid = max(dim.wid, nker(mi.base.bv) + dimup.width());
if (hasDown())
dim.wid = max(dim.wid, dimdown.width());
dim.wid += nwid(bv);
/// returns descent of nucleus if any
int ndes(BufferView const &) const;
/// returns superscript kerning of nucleus if any
- int nker() const;
+ int nker(BufferView const * bv) const;
/// where do we have to draw the scripts?
bool hasLimits() const;
/// clean up empty cells and return true if a cell has been deleted.
///
void draw(PainterInfo &, int x, int y) const;
///
- int kerning() const { return kerning_; }
+ int kerning(BufferView const * bv) const { return kerning_; }
///
bool isRelOp() const;
///
bool final() const;
///
- int kerning() const { return kerning_; }
+ int kerning(BufferView const * bv) const { return kerning_; }
private:
virtual Inset * clone() const;
///
atom_dims_.push_back(d);
dim += d;
if (i == n - 1)
- kerning_ = at->kerning();
+ kerning_ = at->kerning(mi.base.bv);
}
// Cache the dimension.
mi.base.bv->coordCache().arrays().add(this, dim);
/// additional super/subscript shift
int sshift() const { return sshift_; }
/// superscript kerning
- int kerning() const { return kerning_; }
+ int kerning(BufferView const * bv) const { return kerning_; }
///
void swap(MathData & ar) { base_type::swap(ar); }
///
size_t idx() const { return idx_; }
///
- int kerning() const { return mathMacro_.cell(idx_).kerning(); }
+ int kerning(BufferView const * bv) const { return mathMacro_.cell(idx_).kerning(bv); }
private:
///
}
-int MathMacro::kerning() const {
- if (displayMode_ == DISPLAY_NORMAL)
- return expanded_.kerning();
+int MathMacro::kerning(BufferView const * bv) const {
+ if (displayMode_ == DISPLAY_NORMAL && !editing(bv))
+ return expanded_.kerning(bv);
else
return 0;
}
///
void metrics(MetricsInfo & mi, Dimension & dim) const;
///
- int kerning() const;
+ int kerning(BufferView const * bv) const;
/// get cursor position
void cursorPos(BufferView const & bv, CursorSlice const & sl,
bool boundary, int & x, int & y) const;