MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / align

Method align

forms/control.cpp:964–980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962}
963
964int Control::align(HorizontalAlignment HAlign, int ParentWidth, int ChildWidth)
965{
966 int x = 0;
967 switch (HAlign)
968 {
969 case HorizontalAlignment::Left:
970 x = 0;
971 break;
972 case HorizontalAlignment::Centre:
973 x = (ParentWidth / 2) - (ChildWidth / 2);
974 break;
975 case HorizontalAlignment::Right:
976 x = ParentWidth - ChildWidth;
977 break;
978 }
979 return x;
980}
981
982int Control::align(VerticalAlignment VAlign, int ParentHeight, int ChildHeight)
983{

Callers 2

updateImageMethod · 0.80
MessageBoxMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected