Fix bug with showing hidden wxGrid lines when resizing an adjacent one.
Don't blindly assume that the previous line is big enough if the current one isn't in wxGrid::PosToEdgeOfLine() (this assumption is wrong even without taking hiding into account...). Closes #14947. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -579,6 +579,7 @@ All (GUI):
|
|||||||
- Add wxBitmapButton::NewCloseButton().
|
- Add wxBitmapButton::NewCloseButton().
|
||||||
- Add wxTextEntry::SelectNone() (troelsk).
|
- Add wxTextEntry::SelectNone() (troelsk).
|
||||||
- Restore the original wxGrid col/row size when unhiding it (Michael Richards).
|
- Restore the original wxGrid col/row size when unhiding it (Michael Richards).
|
||||||
|
- Don't show hidden wxGrid columns/rows when resizing them (Michael Richards).
|
||||||
- Fix text origin and extent computations in wxSVGFileDC (Neil Chittenden).
|
- Fix text origin and extent computations in wxSVGFileDC (Neil Chittenden).
|
||||||
- Show tooltips for the too long items in generic wxTreeCtrl (Steven Houchins).
|
- Show tooltips for the too long items in generic wxTreeCtrl (Steven Houchins).
|
||||||
- Add wxStyledTextCtrl::AnnotationClearLine() (sentieshar).
|
- Add wxStyledTextCtrl::AnnotationClearLine() (sentieshar).
|
||||||
|
@@ -6663,7 +6663,7 @@ int wxGrid::XToPos(int x) const
|
|||||||
return PosToLinePos(x, true /* clip */, wxGridColumnOperations());
|
return PosToLinePos(x, true /* clip */, wxGridColumnOperations());
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the row number such that the y coord is near the edge of, or -1 if
|
// return the row/col number such that the pos is near the edge of, or -1 if
|
||||||
// not near an edge.
|
// not near an edge.
|
||||||
//
|
//
|
||||||
// notice that position can only possibly be near an edge if the row/column is
|
// notice that position can only possibly be near an edge if the row/column is
|
||||||
@@ -6672,21 +6672,20 @@ int wxGrid::XToPos(int x) const
|
|||||||
// _never_ be considered to be near the edge).
|
// _never_ be considered to be near the edge).
|
||||||
int wxGrid::PosToEdgeOfLine(int pos, const wxGridOperations& oper) const
|
int wxGrid::PosToEdgeOfLine(int pos, const wxGridOperations& oper) const
|
||||||
{
|
{
|
||||||
const int line = oper.PosToLine(this, pos, true);
|
// Get the bottom or rightmost line that could match.
|
||||||
|
int line = oper.PosToLine(this, pos, true);
|
||||||
|
|
||||||
if ( oper.GetLineSize(this, line) > WXGRID_LABEL_EDGE_ZONE )
|
// Go backwards until we find a line that is big enough.
|
||||||
|
while ( oper.GetLineSize(this, line) <= WXGRID_LABEL_EDGE_ZONE )
|
||||||
{
|
{
|
||||||
// We know that we are in this line, test whether we are close enough
|
line = oper.GetLineBefore(this, line);
|
||||||
// to start or end border, respectively.
|
if ( line <= 0 )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the bottom or right touches then we have a match
|
||||||
if ( abs(oper.GetLineEndPos(this, line) - pos) < WXGRID_LABEL_EDGE_ZONE )
|
if ( abs(oper.GetLineEndPos(this, line) - pos) < WXGRID_LABEL_EDGE_ZONE )
|
||||||
return line;
|
return line;
|
||||||
else if ( line > 0 &&
|
|
||||||
pos - oper.GetLineStartPos(this,
|
|
||||||
line) < WXGRID_LABEL_EDGE_ZONE )
|
|
||||||
{
|
|
||||||
return oper.GetLineBefore(this, line);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user