]> git.lyx.org Git - features.git/commitdiff
bug 2167: previews badly placed when ascent or descent is 0
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 24 Feb 2006 14:24:17 +0000 (14:24 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 24 Feb 2006 14:24:17 +0000 (14:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13273 a592a061-630c-0410-9148-cb99ea01b6c8

lib/ChangeLog
lib/scripts/legacy_lyxpreview2ppm.py
lib/scripts/lyxpreview2bitmap.py

index 0ad1f7b6b5feebb5f9751245d73e6b5e096f9a6f..7622e631ca8b30920257c335f0bd1b38b13fe252 100644 (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
index b3b743a4bae4075837c90f8ecf9d0bada8cd314a..f887b5c4dce96f95cfc027a034d62f1a8b49a0ee 100644 (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
 
index 3d3569e59b499bbc15b6d36869e08783863a8753..2d73c99d23d394ace934620047255619e8ac0b82 100755 (executable)
@@ -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)