bool metrics(MetricsInfo & mi, Dimension & dim) const;
///
void draw(PainterInfo &, int x, int y) const;
+ ///
+ int kerning() const { return mathMacro_.cell(idx_).kerning(); }
private:
std::auto_ptr<Inset> doClone() const;
macro.unlock();
mathMacro_.cell(idx_).metrics(mi, dim);
macro.lock();
- metricsMarkers2(dim);
if (dim_ == dim)
return false;
dim_ = dim;
bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const
{
+ kerning_ = 0;
if (!MacroTable::globalMacros().has(name())) {
mathed_string_dim(mi.base.font, "Unknown: " + name(), dim);
} else {
macro.lock();
expanded_.metrics(mi, dim);
macro.unlock();
+ kerning_ = expanded_.kerning();
editing_ = false;
}
}
- metricsMarkers2(dim);
if (dim_ == dim)
return false;
dim_ = dim;
if (editing_ != editing(pi.base.bv) || macroBackup_ != macro)
pi.base.bv->cursor().updateFlags(Update::Force);
}
- drawMarkers2(pi, x, y);
}
}
+bool MathMacro::idxUpDown(Cursor & cur, bool up) const
+{
+ if (up) {
+ if (cur.idx() == 0)
+ return false;
+ --cur.idx();
+ } else {
+ if (cur.idx() + 1 >= nargs())
+ return false;
+ ++cur.idx();
+ }
+ cur.pos() = cell(cur.idx()).x2pos(cur.x_target());
+ return true;
+}
+
+
bool MathMacro::notifyCursorLeaves(Cursor & cur)
{
cur.updateFlags(Update::Force);