]> git.lyx.org Git - features.git/commitdiff
Fix alignment of text within insets.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 5 Sep 2007 22:08:41 +0000 (22:08 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 5 Sep 2007 22:08:41 +0000 (22:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20083 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetCollapsable.cpp

index 98de52f71fe91c9ae2616c0625a58d8495495ee3..5d4e052a9369be10281a6ff8a589e52368f31947 100644 (file)
@@ -250,7 +250,9 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
 
        // Draw button first -- top, left or only
        Dimension dimc = dimensionCollapsed();
-       int const top  = y - ascent() + TEXT_TO_INSET_OFFSET;
+       TextMetrics const & tm = pi.base.bv->textMetrics(&text_);
+       int const top = y - tm.ascent();
+
        if (geometry() == TopButton ||
            geometry() == LeftButton ||
            geometry() == ButtonOnly) {