From 95e09581c5bb6f9a45273164bb4fac99847c8724 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 5 Sep 2007 22:08:41 +0000 Subject: [PATCH] Fix alignment of text within insets. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20083 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetCollapsable.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 98de52f71f..5d4e052a93 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -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) { -- 2.39.2