From 5bad987680e5505282ff3966d8bc5fe513f1f116 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 24 Feb 2006 14:24:17 +0000 Subject: [PATCH] bug 2167: previews badly placed when ascent or descent is 0 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13273 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 6 ++++++ lib/scripts/legacy_lyxpreview2ppm.py | 2 +- lib/scripts/lyxpreview2bitmap.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 0ad1f7b6b5..7622e631ca 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2006-02-24 Enrico Forestieri + + * scripts/legacy_lyxpreview2ppm.py (extract_metrics_info): + * scripts/lyxpreview2bitmap.py (extract_metrics_info): fix + computation when either ascent or descent is 0. (bug 2167) + 2006-02-19 Enrico Forestieri * scripts/lyxpreview2bitmap.py: fix script to work with recent versions diff --git a/lib/scripts/legacy_lyxpreview2ppm.py b/lib/scripts/legacy_lyxpreview2ppm.py index b3b743a4ba..f887b5c4dc 100644 --- a/lib/scripts/legacy_lyxpreview2ppm.py +++ b/lib/scripts/legacy_lyxpreview2ppm.py @@ -95,7 +95,7 @@ def extract_metrics_info(log_file, metrics_file): descent = string.atoi(match.group(3)) frac = 0.5 - if ascent > 0 and descent > 0: + if ascent >= 0 and descent >= 0: ascent = float(ascent) + tp_ascent descent = float(descent) - tp_descent diff --git a/lib/scripts/lyxpreview2bitmap.py b/lib/scripts/lyxpreview2bitmap.py index 3d3569e59b..2d73c99d23 100755 --- a/lib/scripts/lyxpreview2bitmap.py +++ b/lib/scripts/lyxpreview2bitmap.py @@ -103,7 +103,7 @@ def extract_metrics_info(dvipng_stdout, metrics_file): ascent = string.atof(match.group(2)) frac = 0.5 - if ascent > 0 and descent > 0: + if ascent >= 0 and descent >= 0: if abs(ascent + descent) > 0.1: frac = ascent / (ascent + descent) -- 2.39.5