]> git.lyx.org Git - features.git/commitdiff
InsetText::draw() Painting tweaks; reduce the frame by two pixels.
authorAbdelrazak Younes <younes@lyx.org>
Thu, 14 Feb 2008 08:24:52 +0000 (08:24 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 14 Feb 2008 08:24:52 +0000 (08:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22998 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetText.cpp

index ecfe37be5c9fe3defd3aade582b0386812fc5a06..aa81f6603d1b78dcf6e9e431fe60d7b888c1d947 100644 (file)
@@ -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);
 }