Skip to content

Commit cb209c5

Browse files
committed
Fixed bug where mousedown etc. would not work near end of lines with timestamps
1 parent d83b280 commit cb209c5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

mushview.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,8 @@ COLORREF iBackColour = BLACK;
11541154
pixel += textsize.cx; // start rest of line further over
11551155

11561156
}
1157+
else
1158+
pLine->m_iPreambleOffset = 0; // ensure no offset if they change it
11571159

11581160
// show the selection in a different colour
11591161

@@ -2008,7 +2010,10 @@ int line,
20082010
int iCol;
20092011

20102012
// don't do it *past* end of last word
2011-
long pixel = calculate_width (line, pLine->len, pDoc, dc) + pDoc->m_iPixelOffset + pDoc->m_TextRectangle.left;
2013+
long pixel = calculate_width (line, pLine->len, pDoc, dc) +
2014+
pDoc->m_iPixelOffset +
2015+
pDoc->m_TextRectangle.left +
2016+
pLine->m_iPreambleOffset;
20122017

20132018
if (point.x < pixel &&
20142019
pDoc->FindStyle (pLine, col, iCol, pStyle, foundpos))
@@ -3399,7 +3404,9 @@ ASSERT_VALID(pDoc);
33993404
int iCol;
34003405

34013406
// don't do it *past* end of last word
3402-
long pixel = calculate_width (line, pLine->len, pDoc, dc) + pDoc->m_iPixelOffset;
3407+
long pixel = calculate_width (line, pLine->len, pDoc, dc) +
3408+
pDoc->m_iPixelOffset +
3409+
pLine->m_iPreambleOffset;
34033410

34043411
if (point.x < pixel &&
34053412
pDoc->FindStyle (pLine, col, iCol, pStyle, foundpos))
@@ -4135,7 +4142,10 @@ BOOL CMUSHView::OnToolTipNeedText(UINT id, NMHDR * pNMHDR, LRESULT * pResult)
41354142
int iCol = 0;
41364143

41374144
// don't do it *past* end of last word
4138-
long pixel = calculate_width (line, pLine->len, pDoc, dc) + pDoc->m_iPixelOffset + pDoc->m_TextRectangle.left;
4145+
long pixel = calculate_width (line, pLine->len, pDoc, dc) +
4146+
pDoc->m_iPixelOffset +
4147+
pDoc->m_TextRectangle.left +
4148+
pLine->m_iPreambleOffset;
41394149

41404150
// m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) Translate ("Line information") );
41414151

0 commit comments

Comments
 (0)