fix text background painting.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19925 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-30 22:12:13 +00:00
parent 692363bbca
commit d0b8d63d2c

View File

@ -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);
}