From: Abdelrazak Younes Date: Thu, 14 Feb 2008 08:24:52 +0000 (+0000) Subject: InsetText::draw() Painting tweaks; reduce the frame by two pixels. X-Git-Tag: 1.6.10~6271 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b0b7fbad8e7a4f9fbf7414034498716043e4eac3;p=features.git InsetText::draw() Painting tweaks; reduce the frame by two pixels. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22998 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index ecfe37be5c..aa81f6603d 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -185,13 +185,14 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const TextMetrics & tm = pi.base.bv->textMetrics(&text_); if (drawFrame_ || pi.full_repaint) { - int const w = tm.width() + 2 * TEXT_TO_INSET_OFFSET; + int const w = tm.width() + TEXT_TO_INSET_OFFSET; int const yframe = y - TEXT_TO_INSET_OFFSET - tm.ascent(); int const h = tm.height() + 2 * TEXT_TO_INSET_OFFSET; + int const xframe = x + TEXT_TO_INSET_OFFSET / 2; if (pi.full_repaint) - pi.pain.fillRectangle(x, yframe, w, h, backgroundColor()); + pi.pain.fillRectangle(xframe, yframe, w, h, backgroundColor()); if (drawFrame_) - pi.pain.rectangle(x, yframe, w, h, frameColor()); + pi.pain.rectangle(xframe, yframe, w, h, frameColor()); } tm.draw(pi, x + TEXT_TO_INSET_OFFSET, y); }