From 17ab5f5a3871e9fe44760a934ebd7f1b7760a5a8 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 16 Sep 2010 10:40:19 +0000 Subject: [PATCH] InsetLine: Fix vertical positioning, offset is really an offset from the text baseline, not from the middle of the line. We are now getting much closer to LateX drawing... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35413 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetLine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp index 405e2be7dc..e4dbc7ae7a 100644 --- a/src/insets/InsetLine.cpp +++ b/src/insets/InsetLine.cpp @@ -125,8 +125,8 @@ void InsetLine::metrics(MetricsInfo & mi, Dimension & dim) const Length offset = Length(to_ascii(getParam("offset"))); offset_ = offset.inPixels(max_width, fm.width(char_type('M'))); - dim.asc = max(fm.maxAscent(), offset_ + height_/2); - dim.des = max(fm.maxDescent(), height_/2 - offset_); + dim.asc = max(fm.maxAscent(), offset_ + height_); + dim.des = max(fm.maxDescent(), - offset_); // Cache the inset dimension setDimCache(mi, dim); -- 2.39.2