- void draw(PainterInfo & pi, int x, int y) const {
- LATTEST(pi.base.macro_nesting > 0);
- if (pi.base.macro_nesting == 1)
- pi.base.macro_nesting = 0;
-
- if (mathMacro_->editMetrics(pi.base.bv)) {
- // The only way a ArgumentProxy can appear is in a cell of the
- // MathMacro. Moreover the cells are only drawn in the DISPLAY_FOLDED
- // mode and then, if the macro is edited the monochrome
- // mode is entered by the MathMacro before calling the cells' draw
- // method. Then eventually this code is reached and the proxy leaves
- // monochrome mode temporarely. Hence, if it is not in monochrome
- // here (and the assert triggers in pain.leaveMonochromeMode())
- // it's a bug.
- pi.pain.leaveMonochromeMode();
- mathMacro_->cell(idx_).draw(pi, x, y);
- pi.pain.enterMonochromeMode(Color_mathbg, Color_mathmacroblend);
- } else if (mathMacro_->cell(idx_).empty()) {
- mathMacro_->cell(idx_).setXY(*pi.base.bv, x, y);
- def_.draw(pi, x, y);
- } else
- mathMacro_->cell(idx_).draw(pi, x, y);
-
- if (pi.base.macro_nesting == 0)
- pi.base.macro_nesting = 1;
- }
- ///
- size_t idx() const { return idx_; }
- ///
- int kerning(BufferView const * bv) const