개정판 fb827eb4
Fix: ArrowTextControl에서 중간점을 이동시켜 꺽인선의 길이를 조정 가능하도록 수정
Change-Id: Ic1a3cc1c60055b78c4e131c711091716ac2dd5c6
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
1086 | 1086 |
|
1087 | 1087 |
System.Diagnostics.Debug.WriteLine($"Page Angle : {ViewerDataModel.Instance.PageAngle} GetPoint : {getThumbPoint.X},{getThumbPoint.Y} Change Value : {newpoint.X},{newpoint.Y}"); |
1088 | 1088 |
} |
1089 |
|
|
1090 | 1089 |
} |
1091 | 1090 |
|
1092 | 1091 |
|
... | ... | |
1108 | 1107 |
double newHorizontalChange = e.HorizontalChange; |
1109 | 1108 |
double newVerticalChange = e.VerticalChange; |
1110 | 1109 |
|
1111 |
//if (reSizePoint != new Point(0, 0)) |
|
1112 |
//{ |
|
1113 |
//Point setPoint = Mouse.GetPosition(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanCanvas); |
|
1114 |
|
|
1115 |
Point setPoint = GetPosition(thumb); |
|
1110 |
Point setPoint = GetPosition(thumb); |
|
1116 | 1111 |
|
1117 |
//System.Diagnostics.Debug.WriteLine($"1. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y} Change Value : {newHorizontalChange},{newVerticalChange}"); |
|
1118 |
|
|
1119 |
AdornerMember control = CurrentAdornerMember(thumb); |
|
1120 |
var commentInfo = (control.DrawingData) as CommentUserInfo; |
|
1112 |
AdornerMember control = CurrentAdornerMember(thumb); |
|
1113 |
var commentInfo = (control.DrawingData) as CommentUserInfo; |
|
1121 | 1114 |
|
1122 |
double ratatePointAngle = 0;
|
|
1115 |
double ratatePointAngle = 0; |
|
1123 | 1116 |
|
1124 |
if (commentInfo is ArrowTextControl) |
|
1117 |
if (commentInfo is ArrowTextControl textControl) |
|
1118 |
{ |
|
1119 |
if (textControl.EndPoint == MathSet.getNearPoint(textControl.PointSet, setPoint)) |
|
1125 | 1120 |
{ |
1126 |
var textControl = (commentInfo as ArrowTextControl); |
|
1127 |
|
|
1128 |
if (textControl.EndPoint == MathSet.getNearPoint(textControl.PointSet, setPoint)) //(textControl.MidPoint == MathSet.getNearPoint(textControl.PointSet,setPoint) || |
|
1129 |
|
|
1130 |
{ |
|
1131 |
textControl.CommentAngle = 0; |
|
1132 |
this.AngleValue = 0; |
|
1133 |
ratatePointAngle = commentInfo.VisualPageAngle; |
|
1134 |
} |
|
1135 |
else |
|
1136 |
{ |
|
1137 |
//textControl.CommentAngle = commentInfo.VisualPageAngle + MathSet.returnAngle(textControl.StartPoint, ref tempPoint, ViewerDataModel.Instance.IsPressShift); |
|
1138 |
textControl.OnCreatingMouseMove(textControl.EndPoint, ViewerDataModel.Instance.IsPressShift); |
|
1139 |
this.AngleValue = textControl.CommentAngle; |
|
1140 |
commentInfo.CommentAngle = this.AngleValue; |
|
1141 |
} |
|
1142 |
//CommentAngle = MathSet.returnAngle(this.StartPoint, ref tempPoint, bAxisLocked); |
|
1121 |
textControl.CommentAngle = 0; |
|
1122 |
this.AngleValue = 0; |
|
1123 |
ratatePointAngle = commentInfo.VisualPageAngle; |
|
1143 | 1124 |
} |
1144 |
System.Diagnostics.Debug.WriteLine("## Angle : " + this.AngleValue + " ##"); |
|
1145 |
thumb.Translate(newHorizontalChange, newVerticalChange, this.AngleValue); |
|
1146 |
|
|
1147 |
// 페이지회전에 따른 화살표텍스트 박스의 이동 수정 |
|
1148 |
|
|
1149 |
var newpoint = MathHelper.RotatePoint(new Point(newHorizontalChange, newVerticalChange), new Point(), ratatePointAngle);// commentInfo.VisualPageAngle); |
|
1150 |
|
|
1151 |
Point thumbPoint = MathHelper.RotatePoint(setPoint, new Point(), ratatePointAngle);// commentInfo.VisualPageAngle); |
|
1152 |
|
|
1153 |
//thumbPoint.X = Math.Abs(thumbPoint.X); |
|
1154 |
//thumbPoint.Y = Math.Abs(thumbPoint.Y); |
|
1155 |
|
|
1156 |
//if ((setPoint.X + newpoint.X) < 0 || (Math.Abs(thumbPoint.X) + newpoint.X) - ViewerDataModel.Instance.ImageViewWidth > 0) |
|
1157 |
//{ |
|
1158 |
// newpoint.X = 0; |
|
1159 |
//} |
|
1160 |
|
|
1161 |
//if (setPoint.Y + newpoint.Y < 0 || (Math.Abs(thumbPoint.Y) + newpoint.Y) - ViewerDataModel.Instance.ImageViewHeight > 0) |
|
1162 |
//{ |
|
1163 |
// newpoint.Y = 0; |
|
1164 |
//} |
|
1165 |
|
|
1166 |
commentInfo.OnMoveCtrlPoint(setPoint, newpoint.X, newpoint.Y, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift); |
|
1167 |
|
|
1168 |
//System.Diagnostics.Debug.WriteLine($"3. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}"); |
|
1169 |
control.UpdateThumb(); |
|
1125 |
else |
|
1126 |
{ |
|
1127 |
///textControl.OnMoveCtrlPoint(setPoint, newHorizontalChange, newVerticalChange, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressCtrl); |
|
1128 |
this.AngleValue = textControl.CommentAngle; |
|
1129 |
commentInfo.CommentAngle = this.AngleValue; |
|
1130 |
} |
|
1131 |
} |
|
1132 |
System.Diagnostics.Debug.WriteLine("## Angle : " + this.AngleValue + " ##"); |
|
1133 |
thumb.Translate(newHorizontalChange, newVerticalChange, this.AngleValue); |
|
1170 | 1134 |
|
1171 |
//System.Diagnostics.Debug.WriteLine($"4. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}"); |
|
1172 |
this.BorderUpdate(); |
|
1135 |
// 페이지회전에 따른 화살표텍스트 박스의 이동 수정 |
|
1173 | 1136 |
|
1174 |
//System.Diagnostics.Debug.WriteLine($"5. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}"); |
|
1175 |
//} |
|
1137 |
var newpoint = MathHelper.RotatePoint(new Point(newHorizontalChange, newVerticalChange), new Point(), ratatePointAngle);// commentInfo.VisualPageAngle); |
|
1138 |
commentInfo.OnMoveCtrlPoint(setPoint, newpoint.X, newpoint.Y, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift); |
|
1139 |
control.UpdateThumb(); |
|
1140 |
this.BorderUpdate(); |
|
1176 | 1141 |
} |
1177 | 1142 |
|
1178 | 1143 |
private AdornerMember CurrentAdornerMember(MyThumb thumb) |
... | ... | |
1193 | 1158 |
return result; |
1194 | 1159 |
} |
1195 | 1160 |
|
1196 |
private Point GetPosition(Thumb thumb) |
|
1161 |
private static Point GetPosition(Thumb thumb)
|
|
1197 | 1162 |
{ |
1198 | 1163 |
return new Point(Canvas.GetLeft(thumb), Canvas.GetTop(thumb)); |
1199 | 1164 |
} |
... | ... | |
1206 | 1171 |
this.isDragging = false; |
1207 | 1172 |
DraggerThumb = null; |
1208 | 1173 |
|
1209 |
|
|
1210 | 1174 |
var comments = (from drawing in this.Members |
1211 | 1175 |
select drawing.DrawingData as CommentUserInfo).ToList(); |
1212 | 1176 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
내보내기 Unified diff