mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
* lib/scripts/lyxpreview2bitmap.py: fix frac calculation (bug 2391).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13511 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
b7d59d8ce6
commit
eedb4c6821
@ -103,12 +103,12 @@ 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 or descent >= 0:
|
||||
if abs(ascent + descent) > 0.1:
|
||||
frac = ascent / (ascent + descent)
|
||||
|
||||
# Sanity check
|
||||
if frac < 0 or frac > 1:
|
||||
if frac < 0:
|
||||
frac = 0.5
|
||||
|
||||
metrics.write("Snippet %s %f\n" % (page, frac))
|
||||
|
Loading…
Reference in New Issue
Block a user