개정판 3dbace4e
midpoint 수정
Change-Id: I754f8c8c97395ae48df7b9a063df0b7ab8be72a6
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
38 | 38 |
/// </summary> |
39 | 39 |
/// <param name="e"></param> |
40 | 40 |
/// <param name="angle"></param> |
41 |
public void Translate(double dx, double dy, double angle) |
|
41 |
public void Translate_old(double dx, double dy, double angle)
|
|
42 | 42 |
{ |
43 | 43 |
double radian = angle * Math.PI / 180; |
44 | 44 |
double cos = Math.Cos(radian); |
... | ... | |
46 | 46 |
|
47 | 47 |
double _dx = dx * cos - dy * sin; |
48 | 48 |
double _dy = dx * sin + dy * cos; |
49 |
|
|
49 | 50 |
Canvas.SetLeft(this, Canvas.GetLeft(this) + _dx); |
50 | 51 |
Canvas.SetTop(this, Canvas.GetTop(this) + _dy); |
51 | 52 |
} |
52 | 53 |
|
54 |
public void Translate(double dx, double dy, double angle) |
|
55 |
{ |
|
56 |
var ratotePoint = MathHelper.RotatePoint(new Point(dx, dy), new Point(), angle); |
|
57 |
|
|
58 |
Canvas.SetLeft(this, Canvas.GetLeft(this) + ratotePoint.X); |
|
59 |
Canvas.SetTop(this, Canvas.GetTop(this) + ratotePoint.Y); |
|
60 |
} |
|
61 |
|
|
62 |
|
|
53 | 63 |
/// <summary> |
54 | 64 |
/// </summary> |
55 | 65 |
/// <param name="sender"></param> |
... | ... | |
1052 | 1062 |
if (member.GetType().Name == "ArrowTextControl" && list[i] == (member as ArrowTextControl).MidPoint) |
1053 | 1063 |
{ |
1054 | 1064 |
Canvas.SetZIndex(tm, 95); |
1065 |
tm.DragDelta += MidPoint_DragDelta; |
|
1055 | 1066 |
} |
1056 | 1067 |
else |
1057 | 1068 |
{ |
1069 |
tm.DragDelta += ResizeTm_DragDelta; |
|
1058 | 1070 |
Canvas.SetZIndex(tm, 99); |
1059 | 1071 |
} |
1060 | 1072 |
|
1061 | 1073 |
tm.DragStarted += new DragStartedEventHandler(tm_DragStarted); |
1062 | 1074 |
tm.DragCompleted += new DragCompletedEventHandler(tm_DragCompleted); |
1063 |
tm.DragDelta += ResizeTm_DragDelta; |
|
1075 |
|
|
1064 | 1076 |
tm.MouseMove += new MouseEventHandler(resize_MouseMove); |
1065 | 1077 |
count++; |
1066 | 1078 |
} |
1067 | 1079 |
} |
1068 | 1080 |
|
1081 |
private void MidPoint_DragDelta(object sender, DragDeltaEventArgs e) |
|
1082 |
{ |
|
1083 |
MyThumb thumb = sender as MyThumb; |
|
1084 |
double newHorizontalChange = e.HorizontalChange; |
|
1085 |
double newVerticalChange = e.VerticalChange; |
|
1086 |
|
|
1087 |
var newpoint = MathHelper.RotatePoint(new Point(newHorizontalChange, newVerticalChange), new Point(), ViewerDataModel.Instance.PageAngle);// commentInfo.VisualPageAngle); |
|
1088 |
|
|
1089 |
var direction = VisualHelper.GetPointDirection(newpoint, ViewerDataModel.Instance.PageAngle); |
|
1090 |
|
|
1091 |
System.Diagnostics.Debug.WriteLine("뱡향 : " + direction.ToString()); |
|
1092 |
|
|
1093 |
AdornerMember control = CurrentAdornerMember(thumb); |
|
1094 |
var commentInfo = (control.DrawingData) as CommentUserInfo; |
|
1095 |
|
|
1096 |
if (commentInfo is ArrowTextControl) |
|
1097 |
{ |
|
1098 |
Point getThumbPoint = GetPosition(thumb); |
|
1099 |
|
|
1100 |
var arrowText = commentInfo as ArrowTextControl; |
|
1101 |
|
|
1102 |
//var midPoint = MathSet.getMiddlePoint(arrowText.StartPoint, arrowText.EndPoint); |
|
1103 |
//arrowText.MidPoint = newpoint; |
|
1104 |
thumb.Translate(newpoint.X, newpoint.Y, this.AngleValue); |
|
1105 |
commentInfo.OnMoveCtrlPoint(getThumbPoint, newpoint.X, newpoint.Y, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift); |
|
1106 |
|
|
1107 |
control.UpdateThumb(); |
|
1108 |
|
|
1109 |
System.Diagnostics.Debug.WriteLine($"text {Canvas.GetLeft(arrowText.Base_TextBox)},{Canvas.GetTop(arrowText.Base_TextBox)}"); |
|
1110 |
|
|
1111 |
System.Diagnostics.Debug.WriteLine($"Page Angle : {ViewerDataModel.Instance.PageAngle} GetPoint : {getThumbPoint.X},{getThumbPoint.Y} Change Value : {newpoint.X},{newpoint.Y}"); |
|
1112 |
} |
|
1113 |
|
|
1114 |
} |
|
1115 |
|
|
1116 |
|
|
1069 | 1117 |
private void ResizeTm_DragDelta(object sender, DragDeltaEventArgs e) |
1070 | 1118 |
{ |
1071 | 1119 |
if (sender.GetType() != typeof(MyThumb)) return; |
... | ... | |
1099 | 1147 |
if (textControl.EndPoint == MathSet.getNearPoint(textControl.PointSet, setPoint)) //(textControl.MidPoint == MathSet.getNearPoint(textControl.PointSet,setPoint) || |
1100 | 1148 |
|
1101 | 1149 |
{ |
1102 |
textControl.CommentAngle = 0; |
|
1103 |
this.AngleValue = 0; |
|
1104 |
ratatePointAngle = commentInfo.VisualPageAngle; |
|
1150 |
textControl.CommentAngle = 0;
|
|
1151 |
this.AngleValue = 0;
|
|
1152 |
ratatePointAngle = commentInfo.VisualPageAngle;
|
|
1105 | 1153 |
} |
1106 | 1154 |
else |
1107 | 1155 |
{ |
... | ... | |
1538 | 1586 |
{ |
1539 | 1587 |
AdornerMember control = this.Members.FirstOrDefault(); |
1540 | 1588 |
|
1541 |
if ((control.DrawingData as ArrowTextControl) != null && DraggerThumb == null)
|
|
1589 |
if ((control.DrawingData as ArrowTextControl) != null) |
|
1542 | 1590 |
{ |
1543 | 1591 |
if ((control.DrawingData as ArrowTextControl).isTrans == false && (control.DrawingData as ArrowTextControl).isFixed == false) |
1544 | 1592 |
{ |
내보내기 Unified diff