class InsetColoredCell : public InsetMathNest {
public:
///
- InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max);
+ InsetColoredCell(Buffer * buf, ColorCode blend);
///
- InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max, MathAtom const & atom);
+ InsetColoredCell(Buffer * buf, ColorCode blend, MathAtom const & atom);
///
void draw(PainterInfo &, int x, int y) const;
///
///
Inset * clone() const;
///
- ColorCode min_;
- ///
- ColorCode max_;
+ ColorCode blend_;
};
-InsetColoredCell::InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max)
- : InsetMathNest(buf, 1), min_(min), max_(max)
+InsetColoredCell::InsetColoredCell(Buffer * buf, ColorCode blend)
+ : InsetMathNest(buf, 1), blend_(blend)
{
}
-InsetColoredCell::InsetColoredCell(Buffer * buf, ColorCode min, ColorCode max, MathAtom const & atom)
- : InsetMathNest(buf, 1), min_(min), max_(max)
+InsetColoredCell::InsetColoredCell(Buffer * buf, ColorCode blend, MathAtom const & atom)
+ : InsetMathNest(buf, 1), blend_(blend)
{
cell(0).insert(0, atom);
}
void InsetColoredCell::draw(PainterInfo & pi, int x, int y) const
{
- pi.pain.enterMonochromeMode(min_, max_);
+ pi.pain.enterMonochromeMode(blend_);
cell(0).draw(pi, x, y);
pi.pain.leaveMonochromeMode();
}
// color it light grey, if it is to be removed when the cursor leaves
if (i == argsInLook_) {
optData->push_back(MathAtom(
- new InsetColoredCell(buffer_, Color_mathbg, Color_mathmacrooldarg)));
+ new InsetColoredCell(buffer_, Color_mathmacrooldarg)));
optData = &(*optData)[optData->size() - 1].nucleus()->cell(0);
}
arg.push_back(MathAtom(new InsetMathMacroArgument(i + 1)));
if (i >= argsInLook_) {
look_.push_back(MathAtom(new InsetColoredCell(buffer_,
- Color_mathbg, Color_mathmacrooldarg,
+ Color_mathmacrooldarg,
MathAtom(new InsetMathBrace(arg)))));
} else
look_.push_back(MathAtom(new InsetMathBrace(arg)));
MathData arg;
arg.push_back(MathAtom(new InsetMathMacroArgument(i + 1)));
look_.push_back(MathAtom(new InsetColoredCell(buffer_,
- Color_mathbg, Color_mathmacronewarg,
+ Color_mathmacronewarg,
MathAtom(new InsetMathBrace(arg)))));
}
if (macro)
macro->unlock();
- dim.wid += 6;
- dim.des += 2;
- dim.asc += 2;
+ dim.wid += leftOffset(mi.base.bv) + rightOffset(mi.base.bv);;
+ dim.des += bottomOffset(mi.base.bv);
+ dim.asc += topOffset(mi.base.bv);
}
Dimension const dim = dimension(*pi.base.bv);
// draw outer frame
- int const a = y - dim.asc + 1;
- int const w = dim.wid - 2;
- int const h = dim.height() - 2;
- pi.pain.rectangle(x + 1, a, w, h, Color_mathframe);
+ int const hoffset = leftOffset(pi.base.bv) + rightOffset(pi.base.bv);
+ int const voffset = topOffset(pi.base.bv) + bottomOffset(pi.base.bv);
+ int const a = y - dim.asc + topOffset(pi.base.bv) / 2;
+ int const w = dim.wid - (hoffset - hoffset / 2);
+ int const h = dim.height() - (voffset - voffset / 2);
+ pi.pain.rectangle(x + leftOffset(pi.base.bv) / 2, a, w, h, Color_mathframe);
// just to be sure: set some dummy values for coord cache
for (idx_type i = 0; i < nargs(); ++i)
cell(i).setXY(*pi.base.bv, x, y);
// draw contents
- look_.draw(pi, x + 3, y);
+ look_.draw(pi, x + leftOffset(pi.base.bv), y);
}