1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export var Position = {
|
17 | BOTTOM: "bottom",
|
18 | BOTTOM_LEFT: "bottom-left",
|
19 | BOTTOM_RIGHT: "bottom-right",
|
20 | LEFT: "left",
|
21 | LEFT_BOTTOM: "left-bottom",
|
22 | LEFT_TOP: "left-top",
|
23 | RIGHT: "right",
|
24 | RIGHT_BOTTOM: "right-bottom",
|
25 | RIGHT_TOP: "right-top",
|
26 | TOP: "top",
|
27 | TOP_LEFT: "top-left",
|
28 | TOP_RIGHT: "top-right",
|
29 | };
|
30 | export function isPositionHorizontal(position) {
|
31 |
|
32 | return (position === Position.TOP ||
|
33 | position === Position.TOP_LEFT ||
|
34 | position === Position.TOP_RIGHT ||
|
35 | position === Position.BOTTOM ||
|
36 | position === Position.BOTTOM_LEFT ||
|
37 | position === Position.BOTTOM_RIGHT);
|
38 | }
|
39 | export function isPositionVertical(position) {
|
40 |
|
41 | return (position === Position.LEFT ||
|
42 | position === Position.LEFT_TOP ||
|
43 | position === Position.LEFT_BOTTOM ||
|
44 | position === Position.RIGHT ||
|
45 | position === Position.RIGHT_TOP ||
|
46 | position === Position.RIGHT_BOTTOM);
|
47 | }
|
48 | export function getPositionIgnoreAngles(position) {
|
49 | if (position === Position.TOP || position === Position.TOP_LEFT || position === Position.TOP_RIGHT) {
|
50 | return Position.TOP;
|
51 | }
|
52 | else if (position === Position.BOTTOM ||
|
53 | position === Position.BOTTOM_LEFT ||
|
54 | position === Position.BOTTOM_RIGHT) {
|
55 | return Position.BOTTOM;
|
56 | }
|
57 | else if (position === Position.LEFT || position === Position.LEFT_TOP || position === Position.LEFT_BOTTOM) {
|
58 | return Position.LEFT;
|
59 | }
|
60 | else {
|
61 | return Position.RIGHT;
|
62 | }
|
63 | }
|
64 |
|
\ | No newline at end of file |