protected ContentAlignment RtlTranslateAlignment(ContentAlignment align) {
if (right_to_left == RightToLeft.No) {
return align;
}
switch (align) {
case ContentAlignment.TopLeft: {
return ContentAlignment.TopRight;
}
case ContentAlignment.TopRight: {
return ContentAlignment.TopLeft;
}
case ContentAlignment.MiddleLeft: {
return ContentAlignment.MiddleRight;
}
case ContentAlignment.MiddleRight: {
return ContentAlignment.MiddleLeft;
}
case ContentAlignment.BottomLeft: {
return ContentAlignment.BottomRight;
}
case ContentAlignment.BottomRight: {
return ContentAlignment.BottomLeft;
}
default: {
// if it's center it doesn't change
return align;
}
}
}