1076 |
1076 |
|
1077 |
1077 |
double newHorizontalChange = e.HorizontalChange;
|
1078 |
1078 |
double newVerticalChange = e.VerticalChange;
|
1079 |
|
if((newHorizontalChange <-100 && newHorizontalChange > 100) || (newVerticalChange < -100 && newVerticalChange > 100))
|
1080 |
|
{
|
1081 |
|
return;
|
1082 |
|
}
|
1083 |
|
|
1084 |
|
if((GetPosition(thumb).X + newHorizontalChange) < 0)
|
1085 |
|
{
|
1086 |
|
newHorizontalChange = newHorizontalChange - (GetPosition(thumb).X + newHorizontalChange);
|
1087 |
|
}
|
1088 |
|
|
1089 |
|
if ((GetPosition(thumb).X + thumb.RenderSize.Width + newHorizontalChange) - ViewerDataModel.Instance.ImageViewWidth > 0)
|
1090 |
|
{
|
1091 |
|
newHorizontalChange = newHorizontalChange - ((GetPosition(thumb).X + thumb.RenderSize.Width + newHorizontalChange) - ViewerDataModel.Instance.ImageViewWidth);
|
1092 |
|
}
|
1093 |
|
|
1094 |
|
if (GetPosition(thumb).Y + newVerticalChange < 0 || (GetPosition(thumb).Y + thumb.RenderSize.Height + newVerticalChange) - ViewerDataModel.Instance.ImageViewHeight > 0)
|
1095 |
|
{
|
1096 |
|
newVerticalChange = 0;
|
1097 |
|
}
|
1098 |
1079 |
|
1099 |
1080 |
if (reSizePoint != new Point(0, 0))
|
1100 |
1081 |
{
|
1101 |
1082 |
//Point setPoint = Mouse.GetPosition(Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.zoomAndPanCanvas);
|
1102 |
1083 |
|
1103 |
|
Point setPoint = new Point(Canvas.GetLeft(thumb), Canvas.GetTop(thumb));
|
1104 |
|
|
1105 |
|
System.Diagnostics.Debug.WriteLine($"1. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y} Change Value : {newHorizontalChange},{newVerticalChange}");
|
|
1084 |
Point setPoint = new Point(GetPosition(thumb).X, GetPosition(thumb).Y);
|
|
1085 |
|
|
1086 |
//System.Diagnostics.Debug.WriteLine($"1. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y} Change Value : {newHorizontalChange},{newVerticalChange}");
|
1106 |
1087 |
|
1107 |
1088 |
thumb.Translate(newHorizontalChange, newVerticalChange, this.AngleValue);
|
1108 |
|
|
1109 |
|
AdornerMember control = (from userThumb in this.Members
|
1110 |
|
where userThumb.ThumbList.Contains(thumb)
|
1111 |
|
select userThumb).FirstOrDefault();
|
1112 |
1089 |
|
1113 |
|
IPath AllControl = control.DrawingData as IPath;
|
|
1090 |
AdornerMember control = CurrentAdornerMember(thumb);
|
1114 |
1091 |
|
1115 |
|
// System.Diagnostics.Debug.WriteLine($"2. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
|
1092 |
var commentInfo = (control.DrawingData) as CommentUserInfo;
|
1116 |
1093 |
|
1117 |
|
System.Diagnostics.Debug.WriteLine($"2. GetPoint : {setPoint.X},{setPoint.Y} - {newHorizontalChange},{newVerticalChange}");
|
|
1094 |
// 페이지회전에 따른 화살표텍스트 박스의 이동 수정
|
|
1095 |
var newpoint = MathHelper.RotatePoint(new Point(newHorizontalChange, newVerticalChange), new Point(), commentInfo.VisualPageAngle);
|
|
1096 |
var thumbPoint = MathHelper.RotatePoint(new Point(thumb.RenderSize.Width, thumb.RenderSize.Height), new Point(), commentInfo.VisualPageAngle);
|
1118 |
1097 |
|
1119 |
|
var commentInfo = (control.DrawingData) as CommentUserInfo;
|
1120 |
|
commentInfo.OnMoveCtrlPoint(setPoint, newHorizontalChange, newVerticalChange,ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift);
|
|
1098 |
if ((setPoint.X + newpoint.X) < 0 || (setPoint.X + Math.Abs(thumbPoint.X) + newpoint.X) - ViewerDataModel.Instance.ImageViewWidth > 0)
|
|
1099 |
{
|
|
1100 |
newpoint.X = 0;
|
|
1101 |
}
|
1121 |
1102 |
|
1122 |
|
System.Diagnostics.Debug.WriteLine($"3. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
|
1103 |
if (setPoint.Y + newpoint.Y < 0 || (setPoint.Y + Math.Abs(thumbPoint.Y) + newpoint.Y) - ViewerDataModel.Instance.ImageViewHeight > 0)
|
|
1104 |
{
|
|
1105 |
newpoint.Y = 0;
|
|
1106 |
}
|
|
1107 |
|
|
1108 |
commentInfo.OnMoveCtrlPoint(setPoint, newpoint.X, newpoint.Y, ViewerDataModel.Instance.IsAxisLock || ViewerDataModel.Instance.IsPressShift);
|
|
1109 |
|
|
1110 |
//System.Diagnostics.Debug.WriteLine($"3. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
1123 |
1111 |
control.UpdateThumb();
|
1124 |
1112 |
|
1125 |
|
System.Diagnostics.Debug.WriteLine($"4. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
|
1113 |
//System.Diagnostics.Debug.WriteLine($"4. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
1126 |
1114 |
this.BorderUpdate();
|
1127 |
1115 |
|
1128 |
|
System.Diagnostics.Debug.WriteLine($"5. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
|
1116 |
//System.Diagnostics.Debug.WriteLine($"5. GetPoint : {GetPosition(thumb).X},{GetPosition(thumb).Y}");
|
|
1117 |
}
|
|
1118 |
}
|
|
1119 |
|
|
1120 |
private AdornerMember CurrentAdornerMember(MyThumb thumb)
|
|
1121 |
{
|
|
1122 |
AdornerMember result = null;
|
|
1123 |
|
|
1124 |
try
|
|
1125 |
{
|
|
1126 |
result = (from userThumb in this.Members
|
|
1127 |
where userThumb.ThumbList.Contains(thumb)
|
|
1128 |
select userThumb).FirstOrDefault();
|
|
1129 |
}
|
|
1130 |
catch (Exception ex)
|
|
1131 |
{
|
|
1132 |
App.FileLogger.Error(ex);
|
1129 |
1133 |
}
|
|
1134 |
|
|
1135 |
return result;
|
1130 |
1136 |
}
|
1131 |
1137 |
|
1132 |
1138 |
private Point GetPosition(Thumb thumb)
|
... | ... | |
1260 |
1266 |
//System.Diagnostics.Debug.WriteLine($"TransItem : {horzChange}, {vertChange}");
|
1261 |
1267 |
//System.Diagnostics.Debug.WriteLine($"DragDeltaEventArgs : {e.HorizontalChange}, {e.VerticalChange}");
|
1262 |
1268 |
|
1263 |
|
this.TranslateItems(horzChange, vertChange);
|
|
1269 |
|
1264 |
1270 |
|
1265 |
1271 |
var rect = this.AdornerBorder.Bounds(ViewerDataModel.Instance.SystemMain.dzMainMenu.mainPanel);
|
|
1272 |
|
1266 |
1273 |
var mainRect = ViewerDataModel.Instance.SystemMain.dzMainMenu.mainPanel.Rect();
|
1267 |
1274 |
|
1268 |
1275 |
var moveDirection = mainRect.Movement(rect);
|
... | ... | |
1272 |
1279 |
|
1273 |
1280 |
if ((horzChange < 0 && !moveDirection.Left) || (horzChange > 0 && !moveDirection.Right))
|
1274 |
1281 |
{
|
1275 |
|
this.TranslateItems(horzChange * -1, 0);
|
1276 |
|
e.Handled = true;
|
|
1282 |
horzChange = 0;
|
1277 |
1283 |
}
|
1278 |
1284 |
|
1279 |
1285 |
if ((vertChange < 0 && !moveDirection.Up) || (vertChange > 0 && !moveDirection.Down))
|
1280 |
1286 |
{
|
1281 |
|
this.TranslateItems( 0, vertChange * -1);
|
1282 |
|
e.Handled = true;
|
|
1287 |
vertChange = 0;
|
1283 |
1288 |
}
|
|
1289 |
|
|
1290 |
this.TranslateItems(horzChange, vertChange);
|
|
1291 |
|
|
1292 |
|
1284 |
1293 |
}
|
1285 |
1294 |
finally
|
1286 |
1295 |
{
|