Don't change orthogonal alignment in wxSizerFlags::CenterXXX()

It was unexpected that using wxSizerFlags().Right().CentreVertical()
didn't right-align the item because CentreVertical() reset the alignment
in the horizontal direction rather than just setting it in the vertical
one, so change this, document the new behaviour explicitly and add a new
unit test checking for it.

Closes #18989.
This commit is contained in:
Vadim Zeitlin
2021-01-25 12:58:04 +01:00
parent caf5a62fd9
commit 9130f8bfc6
3 changed files with 45 additions and 4 deletions

View File

@@ -1455,6 +1455,9 @@ public:
them anyhow. For 2D sizers, centering an item in one direction is quite
different from centering it in both directions however.
Note that, unlike Align(), this method doesn't change the vertical
alignment.
@see CentreVertical()
@since 3.1.0
@@ -1467,6 +1470,9 @@ public:
The remarks in CentreHorizontal() documentation also apply to this
function.
Note that, unlike Align(), this method doesn't change the horizontal
alignment.
@since 3.1.0
*/
wxSizerFlags& CentreVertical();