[LyX/master] Fix on-screen vertical alignment in some table cells (#7757)

Juergen Spitzmueller spitz at lyx.org
Sun Jan 24 14:27:43 UTC 2021


commit 40296804136ccc2b908b2b380d4288da7db3cfbb
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sun Jan 24 15:28:37 2021 +0100

    Fix on-screen vertical alignment in some table cells (#7757)
---
 src/insets/InsetTabular.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 7636c46..e11e1d8 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -4497,9 +4497,10 @@ void InsetTabular::metrics(MetricsInfo & mi, Dimension & dim) const
 			tabular.cell_info[r][c].decimal_hoffset = tm.width() - decimal_width;
 			tabular.cell_info[r][c].decimal_width = decimal_width;
 
-			// with LYX_VALIGN_BOTTOM the descent is relative to the last par
-			// = descent of text in last par + bottomOffset:
-			int const lastpardes = tm.last().second->descent()
+			// with LYX_VALIGN_BOTTOM the descent is relative to the last
+			// row of the last par (note that the par might have multile rows!)
+			// = descent of text in last row + bottomOffset:
+			int const lastpardes = tm.last().second->rows().back().descent()
 				+ bottomOffset(mi.base.bv);
 			int offset = 0;
 			switch (tabular.getVAlignment(cell)) {


More information about the lyx-cvs mailing list