개정판 3dbace4e
midpoint 수정
Change-Id: I754f8c8c97395ae48df7b9a063df0b7ab8be72a6
KCOM/Extensions/VisualHelper.cs | ||
---|---|---|
20 | 20 |
return new Rect(element.RenderSize); |
21 | 21 |
} |
22 | 22 |
|
23 |
public static Direction GetPointDirection(Point point,double angle) |
|
24 |
{ |
|
25 |
Direction direction = Direction.None; |
|
26 |
|
|
27 |
double xValue = point.X; |
|
28 |
double yValue = point.Y; |
|
29 |
|
|
30 |
if(0 > xValue && Math.Abs(xValue) > Math.Abs(yValue)) |
|
31 |
{ |
|
32 |
direction = Direction.Left; |
|
33 |
} |
|
34 |
|
|
35 |
if (0 < xValue && Math.Abs(xValue) > Math.Abs(yValue)) |
|
36 |
{ |
|
37 |
direction = Direction.Right; |
|
38 |
} |
|
39 |
|
|
40 |
if (0 > yValue && Math.Abs(xValue) < Math.Abs(yValue)) |
|
41 |
{ |
|
42 |
direction = Direction.Up; |
|
43 |
} |
|
44 |
|
|
45 |
if (0 < yValue && Math.Abs(xValue) < Math.Abs(yValue)) |
|
46 |
{ |
|
47 |
direction = Direction.Down; |
|
48 |
} |
|
49 |
|
|
50 |
return direction; |
|
51 |
} |
|
52 |
|
|
23 | 53 |
public static MoveDirection Movement(this Rect Owner,Rect contentRect) |
24 | 54 |
{ |
25 | 55 |
MoveDirection result = new MoveDirection(); |
... | ... | |
58 | 88 |
|
59 | 89 |
public bool Down { get; set; } |
60 | 90 |
} |
91 |
|
|
92 |
public enum Direction |
|
93 |
{ |
|
94 |
None, |
|
95 |
Left, |
|
96 |
|
|
97 |
Right, |
|
98 |
|
|
99 |
Up, |
|
100 |
|
|
101 |
Down |
|
102 |
} |
|
61 | 103 |
} |
내보내기 Unified diff