btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / kits / interface / Alignment.cpp
blob73470a809fed602402354e83a53234cb7f903cf2
1 /*
2 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
6 #include <Alignment.h>
8 // RelativeHorizontal
9 float
10 BAlignment::RelativeHorizontal() const
12 switch (horizontal) {
13 case B_ALIGN_LEFT:
14 return 0;
15 case B_ALIGN_RIGHT:
16 return 1;
17 case B_ALIGN_HORIZONTAL_CENTER:
18 return 0.5f;
20 default:
21 return (float)horizontal;
25 // RelativeVertical
26 float
27 BAlignment::RelativeVertical() const
29 switch (vertical) {
30 case B_ALIGN_TOP:
31 return 0;
32 case B_ALIGN_BOTTOM:
33 return 1;
34 case B_ALIGN_VERTICAL_CENTER:
35 return 0.5f;
37 default:
38 return (float)vertical;