X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2Fmath_colorinset.C;h=5a87a63f8501f03ca1abb569607505252c49957c;hb=12ac7f339e14c4f76a24f45a21c0697303099145;hp=3d5a68b398fbe52372e583055c46e59ca2dfe26e;hpb=09548338ce3f2b0937c67d3221fab4854ab1d6b8;p=lyx.git diff --git a/src/mathed/math_colorinset.C b/src/mathed/math_colorinset.C index 3d5a68b398..5a87a63f85 100644 --- a/src/mathed/math_colorinset.C +++ b/src/mathed/math_colorinset.C @@ -37,7 +37,7 @@ auto_ptr MathColorInset::clone() const void MathColorInset::metrics(MetricsInfo & mi, Dimension & dim) const { cell(1).metrics(mi, dim); - if (editing()) { + if (editing(mi.base.bv)) { FontSetChanger dummy(mi.base, "textnormal"); cell(0).metrics(mi); dim += cell(0).dim(); @@ -45,7 +45,7 @@ void MathColorInset::metrics(MetricsInfo & mi, Dimension & dim) const dim.asc += 4; dim.des += 4; dim.wid += 2 * w_ + 4; - metricsMarkers(); + metricsMarkers(dim); } dim_ = dim; } @@ -53,7 +53,7 @@ void MathColorInset::metrics(MetricsInfo & mi, Dimension & dim) const void MathColorInset::draw(PainterInfo & pi, int x, int y) const { - if (editing()) { + if (editing(pi.base.bv)) { FontSetChanger dummy(pi.base, "textnormal"); drawMarkers(pi, x, y); drawStrBlack(pi, x, y, "["); @@ -68,6 +68,7 @@ void MathColorInset::draw(PainterInfo & pi, int x, int y) const pi.base.font.setColor(lcolor.getFromGUIName(asString(cell(0)))); cell(1).draw(pi, x, y); pi.base.font.setColor(origcol); + setPosCache(pi, x, y); } @@ -82,7 +83,7 @@ void MathColorInset::write(WriteStream & os) const { if (oldstyle_) os << "{\\color" << '{' << cell(0) << '}' << cell(1) << '}'; - else + else os << "\\textcolor" << '{' << cell(0) << "}{" << cell(1) << '}'; }