changeset 33289:834a6b4f08a4

(VCENTER_BASELINE_OFFSET): Fix previous change. If the font is taller than the frame line, we don't have to vias the division by two.
author Kenichi Handa <handa@m17n.org>
date Wed, 08 Nov 2000 00:53:11 +0000
parents 522393cef854
children b0b23815e8ca
files src/w32term.c src/xterm.c
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/w32term.c	Wed Nov 08 00:52:25 2000 +0000
+++ b/src/w32term.c	Wed Nov 08 00:53:11 2000 +0000
@@ -1925,9 +1925,10 @@
 */
 
 #define VCENTER_BASELINE_OFFSET(FONT, F)			\
- (FONT_DESCENT (FONT)						\
-  + (FRAME_LINE_HEIGHT ((F)) + 1 - FONT_HEIGHT ((FONT))) / 2	\
-  - (FONT_DESCENT (FRAME_FONT (F)) - FRAME_BASELINE_OFFSET (F)))
+  (FONT_DESCENT (FONT)						\
+   + (FRAME_LINE_HEIGHT ((F)) - FONT_HEIGHT ((FONT))		\
+      + (FRAME_LINE_HEIGHT ((F)) > FONT_HEIGHT ((FONT)))) / 2	\
+   - (FONT_DESCENT (FRAME_FONT (F)) - FRAME_BASELINE_OFFSET (F)))
 
 /* Produce glyphs/get display metrics for the display element IT is
    loaded with.  See the description of struct display_iterator in
--- a/src/xterm.c	Wed Nov 08 00:52:25 2000 +0000
+++ b/src/xterm.c	Wed Nov 08 00:53:11 2000 +0000
@@ -1775,10 +1775,11 @@
 	F_HEIGHT = FRAME_LINE_HEIGHT (F)
 */
 
-#define VCENTER_BASELINE_OFFSET(FONT, F)		\
- ((FONT)->descent						\
-  + (FRAME_LINE_HEIGHT ((F)) + 1 - FONT_HEIGHT ((FONT))) / 2	\
-  - ((F)->output_data.x->font->descent - (F)->output_data.x->baseline_offset))
+#define VCENTER_BASELINE_OFFSET(FONT, F)			\
+  ((FONT)->descent						\
+   + (FRAME_LINE_HEIGHT ((F)) - FONT_HEIGHT ((FONT))		\
+      + (FRAME_LINE_HEIGHT ((F)) > FONT_HEIGHT ((FONT)))) / 2	\
+   - ((F)->output_data.x->font->descent - (F)->output_data.x->baseline_offset))
 
 /* Produce glyphs/get display metrics for the display element IT is
    loaded with.  See the description of struct display_iterator in