Use helper wxRect::CentreIn()
No real changes, just make the code a bit more concise and clear.
This commit is contained in:
@@ -10356,7 +10356,7 @@ wxRect wxGetGridCheckBoxRect(wxWindow* win,
|
|||||||
|
|
||||||
if ( hAlign & wxALIGN_CENTER_HORIZONTAL )
|
if ( hAlign & wxALIGN_CENTER_HORIZONTAL )
|
||||||
{
|
{
|
||||||
checkBoxRect.SetX(cellRect.x + cellRect.width / 2 - checkBoxSize.x / 2);
|
checkBoxRect = checkBoxRect.CentreIn(cellRect, wxHORIZONTAL);
|
||||||
}
|
}
|
||||||
else if ( hAlign & wxALIGN_RIGHT )
|
else if ( hAlign & wxALIGN_RIGHT )
|
||||||
{
|
{
|
||||||
@@ -10369,7 +10369,7 @@ wxRect wxGetGridCheckBoxRect(wxWindow* win,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: support vAlign
|
// TODO: support vAlign
|
||||||
checkBoxRect.SetY(cellRect.y + cellRect.height / 2 - checkBoxSize.y / 2);
|
checkBoxRect = checkBoxRect.CentreIn(cellRect, wxVERTICAL);
|
||||||
|
|
||||||
return checkBoxRect;
|
return checkBoxRect;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user