From d0b8d63d2c892b7f371df7cdc37ee73ed5d33c9a Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 30 Aug 2007 22:12:13 +0000 Subject: [PATCH] fix text background painting. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19925 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetText.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index 64daa1918f..e497d328cb 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -192,16 +192,17 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const TextMetrics & tm = pi.base.bv->textMetrics(&text_); - tm.draw(pi, x + border_, y); - - if (drawFrame_) { - int const w = tm.width() + 2 * border_; + if (drawFrame_ || pi.full_repaint) { + int const w = hasFixedWidth() ? + tm.maxWidth() : tm.width() + 2 * border_; int const a = tm.ascent() + border_; int const h = a + tm.descent() + border_; - pi.pain.rectangle(x, y - a, - (hasFixedWidth() ? tm.maxWidth() : w), - h, frameColor()); + if (pi.full_repaint) + pi.pain.fillRectangle(x, y - a, w, h, backgroundColor()); + if (drawFrame_) + pi.pain.rectangle(x, y - a, w, h, frameColor()); } + tm.draw(pi, x + border_, y); }