dim.wid, dim.asc + dim.des, backgroundColor(pi));
return;
}
- // If there are numbers, the margins around the (displayed)
- // equation have to be cleared.
- if (numberedType())
- pi.pain.fillRectangle(pi.leftx, y - dim.asc,
- pi.rightx - pi.leftx, dim.height(), pi.background_color);
+
pi.pain.fillRectangle(x + 1, y - dim.asc + 1, dim.wid - 2,
- dim.asc + dim.des - 1, pi.backgroundColor(this));
+ dim.height() - 1, pi.backgroundColor(this));
}
}
// First draw the numbers
- ColorCode color = pi.selected && lyxrc.use_system_colors
- ? Color_selectiontext : standardColor();
- bool const really_change_color = pi.base.font.color() == Color_none;
- Changer dummy0 = really_change_color ? pi.base.font.changeColor(color)
- : noChange();
if (numberedType()) {
BufferParams::MathNumber const math_number = buffer().params().getMathNumber();
for (row_type row = 0; row < nrows(); ++row) {
Dimension dimnl;
mathed_string_dim(pi.base.font, nl, dimnl);
if (math_number == BufferParams::LEFT) {
+ ColorCode const col = pi.selected_left
+ ? Color_selectiontext
+ : pi.base.font.color();
+ Changer dummy0 = pi.base.font.changeColor(col);
if (dimnl.wid > x - pi.leftx)
yy += rowinfo(row).descent + dimnl.asc;
+ pi.pain.fillRectangle(pi.leftx, yy - dimnl.asc,
+ dimnl.width(), dimnl.height(),
+ pi.selected_left ? Color_selection : pi.background_color);
pi.draw(pi.leftx, yy, nl);
} else {
+ ColorCode const col = pi.selected_right
+ ? Color_selectiontext
+ : pi.base.font.color();
+ Changer dummy0 = pi.base.font.changeColor(col);
if (dimnl.wid > pi.rightx - x - dim.wid)
yy += rowinfo(row).descent + dimnl.asc;
+ pi.pain.fillRectangle(pi.rightx - dimnl.wid, yy - dimnl.asc,
+ dimnl.width(), dimnl.height(),
+ pi.selected_right ? Color_selection : pi.background_color);
pi.draw(pi.rightx - dimnl.wid, yy, nl);
}
}
}
// Then the equations
+ ColorCode color = pi.selected && lyxrc.use_system_colors
+ ? Color_selectiontext : standardColor();
+ bool const really_change_color = pi.base.font.color() == Color_none;
+ Changer dummy0 = really_change_color ? pi.base.font.changeColor(color)
+ : noChange();
Changer dummy1 = pi.base.changeFontSet(standardFont());
Changer dummy2 = pi.base.font.changeStyle(display() ? DISPLAY_STYLE
: TEXT_STYLE);
}
-Inset::RowFlags InsetMathHull::rowFlags() const
+int InsetMathHull::rowFlags() const
{
switch (type_) {
case hullUnknown:
// and we simply do not have that in InsetMathGrid.
void InsetMathHull::mathmlize(MathMLStream & ms) const
{
- bool const havenumbers = haveNumbers();
- bool const havetable = havenumbers || nrows() > 1 || ncols() > 1;
+ bool const havetable = haveNumbers() || nrows() > 1 || ncols() > 1;
+
+ if (havetable) {
+ if (getType() == hullSimple) {
+ ms << MTag("mtable");
+ } else if (getType() >= hullAlign && getType() <= hullXXAlignAt) {
+ string alignment;
+ for (col_type col = 0; col < ncols(); ++col) {
+ alignment += (col % 2) ? "left " : "right ";
+ }
+ ms << MTag("mtable", "displaystyle='true' columnalign='" + alignment + "'");
+ } else {
+ ms << MTag("mtable", "displaystyle='true'");
+ }
+ }
- if (havetable)
- ms << MTag("mtable");
char const * const celltag = havetable ? "mtd" : "mrow";
// FIXME There does not seem to be wide support at the moment
// for mlabeledtr, so we have to use just mtr for now.
- // char const * const rowtag = havenumbers ? "mlabeledtr" : "mtr";
+ // char const * const rowtag = haveNumbers() ? "mlabeledtr" : "mtr";
char const * const rowtag = "mtr";
for (row_type row = 0; row < nrows(); ++row) {
if (havetable)
<< ETag(celltag);
}
// fleqn?
- if (havenumbers) {
+ if (haveNumbers()) {
ms << MTag("mtd");
docstring const & num = numbers_[row];
if (!num.empty())
ms << MTagInline("mtext") << '(' << num << ')' << ETagInline("mtext");
- ms << ETag("mtd");
+ ms << ETag("mtd");
}
if (havetable)
ms << ETag(rowtag);