From 50072b94316ed509e562bf1f22d0e91de6ee9b8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Mon, 27 Oct 2003 16:59:09 +0000 Subject: [PATCH] remove strain on Angus's eyes. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7988 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/math_colorinset.C | 41 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/src/mathed/math_colorinset.C b/src/mathed/math_colorinset.C index e6e6eb0e4e..ec3edee0da 100644 --- a/src/mathed/math_colorinset.C +++ b/src/mathed/math_colorinset.C @@ -35,30 +35,33 @@ auto_ptr MathColorInset::clone() const void MathColorInset::metrics(MetricsInfo & mi, Dimension & dim) const { - FontSetChanger dummy(mi.base, "textnormal"); - w_ = mathed_char_width(mi.base.font, '['); - MathNestInset::metrics(mi); - dim_ = cell(0).dim(); - dim_.asc += 4; - dim_.des += 4; - dim_ += cell(1).dim(); - dim_.wid += 2 * w_ + 4; - metricsMarkers(); - dim = dim_; + cell(1).metrics(mi, dim); + if (editing()) { + FontSetChanger dummy(mi.base, "textnormal"); + cell(0).metrics(mi); + dim += cell(0).dim(); + w_ = mathed_char_width(mi.base.font, '['); + dim.asc += 4; + dim.des += 4; + dim.wid += 2 * w_ + 4; + metricsMarkers(); + } + dim_ = dim; } void MathColorInset::draw(PainterInfo & pi, int x, int y) const { - FontSetChanger dummy(pi.base, "textnormal"); - drawMarkers(pi, x, y); - - drawStrBlack(pi, x, y, "["); - x += w_; - cell(0).draw(pi, x, y); - x += cell(0).width(); - drawStrBlack(pi, x, y, "]"); - x += w_ + 2; + if (editing()) { + FontSetChanger dummy(pi.base, "textnormal"); + drawMarkers(pi, x, y); + drawStrBlack(pi, x, y, "["); + x += w_; + cell(0).draw(pi, x, y); + x += cell(0).width(); + drawStrBlack(pi, x, y, "]"); + x += w_ + 2; + } ColorChanger dummy1(pi.base.font, asString(cell(0))); cell(1).draw(pi, x, y); -- 2.39.5