From 4bf874c30e99f2a6477e844ff684749745b9ef6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Vigna?= Date: Tue, 23 Apr 2002 13:14:27 +0000 Subject: [PATCH] Fix off by one error in tabular draw selection code. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4045 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 4 ++++ src/insets/insettabular.C | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 9cfbaf2c08..0fb817c423 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2002-04-23 Juergen Vigna + + * insettabular.C (drawCellSelection): fix off by 1 error. + 2002-04-22 Juergen Vigna * insettabular.C (setFont): rewoke full selection if it was asked, diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 1aa1b9f01c..c36104fbdb 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -450,8 +450,8 @@ void InsetTabular::drawCellLines(Painter & pain, int x, int baseline, on_off ? Painter::line_onoffdash : Painter::line_solid); } on_off = !tabular->BottomLine(cell); - pain.line(x,baseline + tabular->GetDescentOfRow(row), - x2, baseline + tabular->GetDescentOfRow(row), + pain.line(x, baseline + tabular->GetDescentOfRow(row), + x2, baseline + tabular->GetDescentOfRow(row), on_off ? LColor::tabularonoffline : LColor::tabularline, on_off ? Painter::line_onoffdash : Painter::line_solid); if (!tabular->LeftAlreadyDrawed(cell)) { @@ -491,8 +491,8 @@ void InsetTabular::drawCellSelection(Painter & pain, int x, int baseline, if ((column >= cs) && (column <= ce) && (row >= rs) && (row <= re)) { int w = tabular->GetWidthOfColumn(cell); - int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row); - pain.fillRectangle(x, baseline - tabular->GetAscentOfRow(row), + int h = tabular->GetAscentOfRow(row) + tabular->GetDescentOfRow(row)-1; + pain.fillRectangle(x, baseline - tabular->GetAscentOfRow(row) + 1, w, h, LColor::selection); } }