From 5646c05be7dfff6e340224d81a1e9f298702f232 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 20 Apr 2014 19:39:48 -0700 Subject: [PATCH] Draw the active line box on top of the grid columns --- src/base_grid.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/base_grid.cpp b/src/base_grid.cpp index e4c43c887..f963096b8 100644 --- a/src/base_grid.cpp +++ b/src/base_grid.cpp @@ -370,15 +370,8 @@ void BaseGrid::OnPaint(wxPaintEvent &) { } // Draw grid - if (curDiag == active_line) { - dc.SetPen(wxPen(to_wx(OPT_GET("Colour/Subtitle Grid/Active Border")->GetColor()))); - dc.SetBrush(*wxTRANSPARENT_BRUSH); - dc.DrawRectangle(0, y, w, lineHeight + 1); - } - else { - dc.SetPen(grid_pen); - dc.DrawLine(0, y + lineHeight, w , y + lineHeight); - } + dc.SetPen(grid_pen); + dc.DrawLine(0, y + lineHeight, w , y + lineHeight); dc.SetPen(*wxTRANSPARENT_PEN); } @@ -395,6 +388,11 @@ void BaseGrid::OnPaint(wxPaintEvent &) { dc.DrawLine(0, 0, 0, maxH); dc.DrawLine(w - 1, 0, w - 1, maxH); } + if (active_line && active_line->Row >= yPos && active_line->Row < yPos + nDraw) { + dc.SetPen(wxPen(to_wx(OPT_GET("Colour/Subtitle Grid/Active Border")->GetColor()))); + dc.SetBrush(*wxTRANSPARENT_BRUSH); + dc.DrawRectangle(0, (active_line->Row - yPos + 1) * lineHeight, w, lineHeight + 1); + } } void BaseGrid::OnSize(wxSizeEvent &) {