- MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
- sshift_(0), kerning_(0), buffer_(buf) {}
+ explicit MathData(Buffer * buf = 0) : minasc_(0), mindes_(0), slevel_(0),
+ sshift_(0), buffer_(buf) {}
bool addToMathRow(MathRow &, MetricsInfo & mi) const;
/// rebuild cached metrics information
bool addToMathRow(MathRow &, MetricsInfo & mi) const;
/// rebuild cached metrics information
- void metrics(MetricsInfo & mi, Dimension & dim) const;
+ /** When \c tight is true, the height of the cell will be at least
+ * the x height of the font. Otherwise, it will be the max height
+ * of the font.
+ */
+ void metrics(MetricsInfo & mi, Dimension & dim, bool tight = true) const;
/// redraw cell using cache metrics information
void draw(PainterInfo & pi, int x, int y) const;
/// rebuild cached metrics information
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
/// redraw cell using cache metrics information
void drawT(TextPainter & pi, int x, int y) const;
/// redraw cell using cache metrics information
void draw(PainterInfo & pi, int x, int y) const;
/// rebuild cached metrics information
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
/// redraw cell using cache metrics information
void drawT(TextPainter & pi, int x, int y) const;
int slevel() const { return slevel_; }
/// additional super/subscript shift
int sshift() const { return sshift_; }
int slevel() const { return slevel_; }
/// additional super/subscript shift
int sshift() const { return sshift_; }
///
void swap(MathData & ar) { base_type::swap(ar); }
/// attach/detach arguments to macros, updating the cur to
/// stay visually at the same position (cur==0 is allowed)
///
void swap(MathData & ar) { base_type::swap(ar); }
/// attach/detach arguments to macros, updating the cur to
/// stay visually at the same position (cur==0 is allowed)
- void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType);
+ void updateMacros(Cursor * cur, MacroContext const & mc, UpdateType, int nesting);
private:
/// is this an exact match at this position?
bool find1(MathData const & ar, size_type pos) const;
private:
/// is this an exact match at this position?
bool find1(MathData const & ar, size_type pos) const;
const size_type macroNumArgs, const int macroOptionals,
const bool fromInitToNormalMode, const bool interactiveInit,
const size_t appetite);
///
const size_type macroNumArgs, const int macroOptionals,
const bool fromInitToNormalMode, const bool interactiveInit,
const size_t appetite);
///
- void collectOptionalParameters(Cursor * cur,
- const size_type numOptionalParams, std::vector<MathData> & params,
+ void collectOptionalParameters(Cursor * cur,
+ const size_type numOptionalParams, std::vector<MathData> & params,
size_t & pos, MathAtom & scriptToPutAround,
const pos_type macroPos, const int thisPos, const int thisSlice);
///
size_t & pos, MathAtom & scriptToPutAround,
const pos_type macroPos, const int thisPos, const int thisSlice);
///
- void collectParameters(Cursor * cur,
- const size_type numParams, std::vector<MathData> & params,
+ void collectParameters(Cursor * cur,
+ const size_type numParams, std::vector<MathData> & params,
size_t & pos, MathAtom & scriptToPutAround,
const pos_type macroPos, const int thisPos, const int thisSlice,
const size_t appetite);
size_t & pos, MathAtom & scriptToPutAround,
const pos_type macroPos, const int thisPos, const int thisSlice,
const size_t appetite);