mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
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:
parent
692363bbca
commit
d0b8d63d2c
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user