changeset 58174:1e3a9e2d4cad

(struct glyph_row): New member extra_line_spacing. (struct it): New member max_extra_line_spacing. (MR_PARTIALLY_VISIBLE, MR_PARTIALLY_VISIBLE_AT_TOP) (MR_PARTIALLY_VISIBLE_AT_BOTTOM): New helper macros. (MATRIX_ROW_PARTIALLY_VISIBLE_P): Fix to return false if invisible part of last line is only extra line spacing (so the text on the line is fully visible). Use helper macros. Add W arg (to use them). All callers changed. (MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P) (MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P): Use helper macros.
author Kim F. Storm <storm@cua.dk>
date Fri, 12 Nov 2004 14:26:34 +0000
parents 46e6d0e52da4
children eeb5474ef89f
files src/dispextern.h
diffstat 1 files changed, 33 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/dispextern.h	Fri Nov 12 14:21:27 2004 +0000
+++ b/src/dispextern.h	Fri Nov 12 14:26:34 2004 +0000
@@ -694,6 +694,10 @@
      frames.  It may be < 0 in case of completely invisible rows.  */
   int visible_height;
 
+  /* Extra line spacing added after this row.  Do not consider this
+     in last row when checking if row is fully visible.  */
+  int extra_line_spacing;
+
   /* Hash code.  This hash code is available as soon as the row
      is constructed, i.e. after a call to display_line.  */
   unsigned hash;
@@ -916,22 +920,39 @@
 
 #define MATRIX_ROW_DISPLAYS_TEXT_P(ROW) ((ROW)->displays_text_p)
 
+
+/* Helper macros */
+
+#define MR_PARTIALLY_VISIBLE(ROW)	\
+  ((ROW)->height != (ROW)->visible_height)
+
+#define MR_PARTIALLY_VISIBLE_AT_TOP(W, ROW)  \
+  ((ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W)))
+
+#define MR_PARTIALLY_VISIBLE_AT_BOTTOM(W, ROW)  \
+  (((ROW)->y + (ROW)->height - (ROW)->extra_line_spacing) \
+   > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W)))
+
 /* Non-zero if ROW is not completely visible in window W.  */
 
-#define MATRIX_ROW_PARTIALLY_VISIBLE_P(ROW)	\
-     ((ROW)->height != (ROW)->visible_height)
+#define MATRIX_ROW_PARTIALLY_VISIBLE_P(W, ROW)		\
+  (MR_PARTIALLY_VISIBLE ((ROW))				\
+   && (MR_PARTIALLY_VISIBLE_AT_TOP ((W), (ROW))		\
+       || MR_PARTIALLY_VISIBLE_AT_BOTTOM ((W), (ROW))))
+
+
 
 /* Non-zero if ROW is partially visible at the top of window W.  */
 
 #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW)		\
-     (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW))			\
-      && (ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W)))
+  (MR_PARTIALLY_VISIBLE ((ROW))					\
+   && MR_PARTIALLY_VISIBLE_AT_TOP ((W), (ROW)))
 
 /* Non-zero if ROW is partially visible at the bottom of window W.  */
 
-#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW)		      \
-     (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW))				      \
-      && (ROW)->y + (ROW)->height > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W)))
+#define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW)	\
+  (MR_PARTIALLY_VISIBLE ((ROW))					\
+   && MR_PARTIALLY_VISIBLE_AT_BOTTOM ((W), (ROW)))
 
 /* Return the bottom Y + 1 of ROW.   */
 
@@ -1990,10 +2011,13 @@
      line, if the window has one.  */
   int last_visible_y;
 
-  /* Additional space in pixels between lines (for window systems
-     only.)  */
+  /* Default amount of additional space in pixels between lines (for
+     window systems only.)  */
   int extra_line_spacing;
 
+  /* Max extra line spacing added in this row.  */
+  int max_extra_line_spacing;
+
   /* Override font height information for this glyph.
      Used if override_ascent >= 0.  Cleared after this glyph.  */
   int override_ascent, override_descent, override_boff;