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
This commit is contained in:
Jean-Marc Lasgouttes 2006-02-24 14:24:17 +00:00
parent 215476903e
commit 5bad987680
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2006-02-24 Enrico Forestieri <forenr@tlc.unipr.it>
* 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 <forenr@tlc.unipr.it>
* scripts/lyxpreview2bitmap.py: fix script to work with recent versions

View File

@ -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

View File

@ -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)