개정판 3797ff05
불필요 주석 및 사용하지 않는 변수 삭제
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
296 | 296 |
content.StartPoint = new Point(Canvas.GetLeft(content), Canvas.GetTop(content)); |
297 | 297 |
content.EndPoint = content.StartPoint; |
298 | 298 |
|
299 |
//RegistryPoint(AllControl.PointSet); |
|
300 | 299 |
} |
301 | 300 |
else |
302 | 301 |
{ |
... | ... | |
319 | 318 |
switch (member.GetType().Name) |
320 | 319 |
{ |
321 | 320 |
#region 컨트롤 조건 |
322 |
case "LineControl": //Angle추가 안했음
|
|
321 |
case "LineControl": |
|
323 | 322 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.SingleLine, ThumbList = new List<Thumb>() }); |
324 | 323 |
break; |
325 |
case "ImgControl": //Angle추가 안했음
|
|
324 |
case "ImgControl": |
|
326 | 325 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ImgControl, ThumbList = new List<Thumb>() }); |
327 |
break; |
|
328 |
//case "SymControl": //Angle추가 안했음 |
|
329 |
// MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = MarkupType.Viewbox, ThumbList = new List<Thumb>() }); |
|
330 |
// break; |
|
331 |
//case "SymControlN": //Angle추가 안했음 |
|
332 |
// MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = MarkupType.Viewbox, ThumbList = new List<Thumb>() }); |
|
333 |
// ViewBoxRotate(member); |
|
334 |
// break; |
|
326 |
break; |
|
335 | 327 |
case "ArrowControl": |
336 | 328 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.ArrowLine, ThumbList = new List<Thumb>() }); |
337 | 329 |
break; |
338 |
case "PolygonControl": //Angle추가 안했음
|
|
330 |
case "PolygonControl": |
|
339 | 331 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.PolygonControl, ThumbList = new List<Thumb>() }); |
340 | 332 |
break; |
341 | 333 |
case "ArrowTextControl": |
... | ... | |
366 | 358 |
case "RectCloudControl": |
367 | 359 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.RectCloud, ThumbList = new List<Thumb>() }); |
368 | 360 |
break; |
369 |
//강인구 추가 |
|
370 | 361 |
case "SignControl": |
371 | 362 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Sign, ThumbList = new List<Thumb>() }); |
372 | 363 |
break; |
... | ... | |
376 | 367 |
case "SymControlN": |
377 | 368 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Stamp, ThumbList = new List<Thumb>() }); |
378 | 369 |
break; |
379 |
case "InkControl": //Angle추가 안했음
|
|
370 |
case "InkControl": |
|
380 | 371 |
MemberSet.Add(new AdornerMember { DrawingData = member, Drawingtype = ControlType.Ink, ThumbList = new List<Thumb>() }); |
381 | 372 |
break; |
382 | 373 |
case "TextControl": |
... | ... | |
386 | 377 |
BorderUpdate(); |
387 | 378 |
try |
388 | 379 |
{ |
389 |
((TextControl)member).Base_TextBlock.TextDecorations = ((TextControl)member).UnderLine; //확인 0403
|
|
380 |
((TextControl)member).Base_TextBlock.TextDecorations = ((TextControl)member).UnderLine; |
|
390 | 381 |
} |
391 | 382 |
catch (Exception) |
392 | 383 |
{ |
... | ... | |
405 | 396 |
} |
406 | 397 |
if (member.GetType().Name == "TextControl") |
407 | 398 |
{ |
408 |
//강인구 추가 |
|
409 | 399 |
TextControl content = ((TextControl)member); |
410 | 400 |
content.StartPoint = new Point(Canvas.GetLeft(content), Canvas.GetTop(content)); |
411 | 401 |
content.EndPoint = content.StartPoint; |
412 |
//RegistryPoint(AllControl.PointSet); |
|
413 | 402 |
} |
414 | 403 |
else |
415 | 404 |
{ |
... | ... | |
466 | 455 |
textControlWidth = ((currentControl as TextControl).Base_TextBox.ActualWidth); |
467 | 456 |
textControlHeight = ((currentControl as TextControl).Base_TextBox.ActualHeight); |
468 | 457 |
} |
469 |
|
|
470 |
//Border 사이즈 불필요 |
|
471 |
|
|
472 |
//if ((currentControl as TextControl).LineSize.Left == 0) |
|
473 |
//{ |
|
474 |
// if (TextCompensation) |
|
475 |
// { |
|
476 |
|
|
477 |
// textControlWidth += 1; |
|
478 |
// textControlHeight += 1; |
|
479 |
// } |
|
480 |
// else |
|
481 |
// { |
|
482 |
// textControlWidth += 3; |
|
483 |
// textControlHeight += 3; |
|
484 |
// } |
|
485 |
//} |
|
486 |
//else |
|
487 |
//{ |
|
488 |
// if (TextCompensation) |
|
489 |
// { |
|
490 |
|
|
491 |
// textControlWidth += 1; |
|
492 |
// textControlHeight += 1; |
|
493 |
// } |
|
494 |
// else |
|
495 |
// { |
|
496 |
// textControlWidth += 8; |
|
497 |
// textControlHeight += 8; |
|
498 |
// } |
|
499 |
//} |
|
500 |
|
|
458 |
|
|
501 | 459 |
if ((currentControl as TextControl).EndPoint.X < minX) |
502 | 460 |
{ |
503 | 461 |
minX = (currentControl as TextControl).EndPoint.X; |
... | ... | |
532 | 490 |
{ |
533 | 491 |
X = (currentControl as IPath).StartPoint.X, |
534 | 492 |
Y = (currentControl as IPath).StartPoint.Y, |
535 |
//Width = (currentControl as IPath).EndPoint.X - (currentControl as IPath).StartPoint.X, |
|
536 |
//Height = (currentControl as IPath).EndPoint.Y - (currentControl as IPath).StartPoint.Y |
|
537 | 493 |
Width = Math.Max((currentControl as IPath).EndPoint.X, (currentControl as IPath).StartPoint.X) - Math.Min((currentControl as IPath).EndPoint.X, (currentControl as IPath).StartPoint.X), |
538 | 494 |
Height = Math.Max((currentControl as IPath).EndPoint.Y, (currentControl as IPath).StartPoint.Y) - Math.Min((currentControl as IPath).EndPoint.Y, (currentControl as IPath).StartPoint.Y), |
539 | 495 |
}; |
... | ... | |
557 | 513 |
if (rt.Bottom > maxY) maxY = rt.Bottom; |
558 | 514 |
} |
559 | 515 |
else if ((currentControl as CircleControl) != null) |
560 |
{ |
|
561 |
//Rect rt = new Rect |
|
562 |
//{ |
|
563 |
// X = (currentControl as IPath).StartPoint.X, |
|
564 |
// Y = (currentControl as IPath).StartPoint.Y, |
|
565 |
// Width = (currentControl as IPath).EndPoint.X - (currentControl as IPath).StartPoint.X, |
|
566 |
// Height = (currentControl as IPath).EndPoint.Y - (currentControl as IPath).StartPoint.Y |
|
567 |
//}; |
|
568 |
|
|
569 |
//Rect rt = new Rect((currentControl as IPath).StartPoint, (currentControl as IPath).EndPoint); |
|
570 |
//if (rt.Left < minX) minX = rt.Left; |
|
571 |
//if (rt.Top < minY) minY = rt.Top; |
|
572 |
//if (rt.Right > maxX) maxX = rt.Right; |
|
573 |
//if (rt.Bottom > maxY) maxY = rt.Bottom; |
|
574 |
|
|
516 |
{ |
|
575 | 517 |
List<Point> am = (currentControl as IPath).PointSet; |
576 | 518 |
List<double> xSet = am.Select(p => p.X).ToList(); |
577 | 519 |
List<double> ySet = am.Select(p => p.Y).ToList(); |
... | ... | |
675 | 617 |
{ |
676 | 618 |
Thumb tm = new Thumb |
677 | 619 |
{ |
678 |
//Name = String.Format("thumb{0}_{1}", count, member.GetType().Name.ToString()), |
|
679 | 620 |
Style = (Style)this.LayoutRoot.Resources["ThumbResizeStyle"], |
680 | 621 |
}; |
681 | 622 |
|
... | ... | |
807 | 748 |
}; |
808 | 749 |
} |
809 | 750 |
} |
810 |
//if (markT == MarkupType.Polygon || markT == MarkupType.Cloud) |
|
811 |
//{ |
|
812 |
// tm.MouseMove += new MouseEventHandler(resize_MouseMove); |
|
813 |
// tm.DragStarted += new DragStartedEventHandler(tm_DragStarted); |
|
814 |
// tm.DragCompleted += new DragCompletedEventHandler(tm_DragCompleted); |
|
815 |
//} |
|
816 |
//else |
|
817 |
//{ |
|
818 |
// tm.MouseMove += new MouseEventHandler(resize_MouseMove); |
|
819 |
// tm.DragStarted += new DragStartedEventHandler(tm_DragStarted); |
|
820 |
// tm.DragCompleted += new DragCompletedEventHandler(tm_DragCompleted); |
|
821 |
//} |
|
822 |
|
|
751 |
|
|
823 | 752 |
if (member.GetType().Name == "CloudControl") |
824 | 753 |
{ |
825 | 754 |
if (i == list.Count() - 1) |
... | ... | |
845 | 774 |
tm.Visibility = System.Windows.Visibility.Collapsed; |
846 | 775 |
} |
847 | 776 |
} |
848 |
|
|
849 |
//강인구 텀브 없애기 보류 |
|
850 |
//if(cnt > 1) |
|
851 |
//{ |
|
852 |
// tm.Visibility = System.Windows.Visibility.Collapsed; |
|
853 |
//} |
|
854 |
|
|
855 |
|
|
856 |
|
|
857 |
//if (member.GetType().Name == "InkControl") |
|
858 |
//{ |
|
859 |
// tm.Visibility = System.Windows.Visibility.Collapsed; |
|
860 |
//} |
|
861 |
|
|
777 |
|
|
862 | 778 |
this.ContainerContent.Children.Add(tm); |
863 | 779 |
Canvas.SetLeft(tm, list[count].X); |
864 | 780 |
Canvas.SetTop(tm, list[count].Y); |
... | ... | |
881 | 797 |
|
882 | 798 |
private void ResizeTm_DragDelta(object sender, DragDeltaEventArgs e) |
883 | 799 |
{ |
884 |
//한개 이상 선택 시 Resize 금지 |
|
885 | 800 |
if (MemberSet.Count > 1) |
886 | 801 |
return; |
887 | 802 |
if (reSizePoint != new Point(0, 0)) |
... | ... | |
894 | 809 |
e.VerticalChange); |
895 | 810 |
|
896 | 811 |
Point setPoint = new Point(Canvas.GetLeft(thumb), Canvas.GetTop(thumb)); |
897 |
|
|
898 |
|
|
899 |
|
|
900 |
|
|
901 |
//if (this.isDragging && MemberSet.Count <= 1) |
|
902 |
//if (thumb.IsDragging && MemberSet.Count <= 1 && DraggerThumb == thumb) |
|
903 |
//if (DraggerThumb == thumb) |
|
904 |
//{ |
|
905 |
//Point setPoint = reSizePoint; |
|
906 |
//Canvas.SetLeft(thumb, setPoint.X); |
|
907 |
//Canvas.SetTop(thumb, setPoint.Y); |
|
812 |
|
|
908 | 813 |
AdornerMember control = (from userThumb in MemberSet |
909 | 814 |
where userThumb.ThumbList.Contains(thumb) |
910 | 815 |
select userThumb).FirstOrDefault(); |
... | ... | |
917 | 822 |
List<Point> ps = new List<Point>(); |
918 | 823 |
|
919 | 824 |
nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
920 |
//switch (Math.Abs(temp.Angle).ToString()) |
|
921 |
//{ |
|
922 |
|
|
923 |
// case "90": |
|
924 |
// { |
|
925 |
// nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
926 |
// } |
|
927 |
// break; |
|
928 |
// case "270": |
|
929 |
// { |
|
930 |
// nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
931 |
// } |
|
932 |
// break; |
|
933 |
// default: |
|
934 |
// { |
|
935 |
// nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
936 |
// } |
|
937 |
// break; |
|
938 |
//} |
|
825 |
|
|
939 | 826 |
|
940 | 827 |
} |
941 | 828 |
for (int i = 0; i < (control.DrawingData as IPath).PointSet.Count; i++) |
... | ... | |
953 | 840 |
AllControl.updateControl(); |
954 | 841 |
DynamicThumbUpdate(control); |
955 | 842 |
BorderUpdate(); |
956 |
|
|
957 |
//if (control.DrawingData.GetType().Name == "ArrowTextControl") |
|
958 |
//{ |
|
959 |
// Thumb tm = control.ThumbList.Last(); |
|
960 |
// //Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width / 2)); |
|
961 |
// //Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height / 2)); |
|
962 |
// Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width)); |
|
963 |
// Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height)); |
|
964 |
//} |
|
843 |
|
|
965 | 844 |
} |
966 | 845 |
break; |
967 | 846 |
#endregion |
968 |
#region Shape |
|
969 |
//case ControlType.PolygonCloud: |
|
847 |
#region Shape |
|
970 | 848 |
case ControlType.RectCloud: |
971 | 849 |
case ControlType.Rectangle: |
972 | 850 |
if (nearPoint.Equals(AllControl.PointSet[i])) |
... | ... | |
1068 | 946 |
|
1069 | 947 |
DynamicThumbUpdate(control); |
1070 | 948 |
BorderUpdate(); |
1071 |
|
|
1072 |
//if (control.DrawingData.GetType().Name == "ArrowTextControl") |
|
1073 |
//{ |
|
1074 |
// Thumb tm = control.ThumbList.Last(); |
|
1075 |
// //Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width / 2)); |
|
1076 |
// //Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height / 2)); |
|
1077 |
// Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width)); |
|
1078 |
// Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height)); |
|
1079 |
//} |
|
949 |
|
|
1080 | 950 |
} |
1081 | 951 |
break; |
1082 | 952 |
#endregion |
... | ... | |
1113 | 983 |
} |
1114 | 984 |
break; |
1115 | 985 |
#endregion |
1116 |
//강인구 추가 |
|
1117 | 986 |
#region Sign |
1118 | 987 |
case ControlType.Sign: |
1119 | 988 |
if (nearPoint.Equals(AllControl.PointSet[i])) |
... | ... | |
1235 | 1104 |
DynamicThumbUpdate(control); |
1236 | 1105 |
BorderUpdate(); |
1237 | 1106 |
} |
1238 |
break; |
|
1239 |
//case MarkupType.Viewbox: |
|
1240 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
1241 |
// { |
|
1242 |
// AllControl.PointSet[i] = setPoint; |
|
1243 |
// var ReverseP = (i + AllControl.PointSet.Count() / 2) % AllControl.PointSet.Count(); |
|
1244 |
// var PreviousP = (i + (AllControl.PointSet.Count() - 1)) % AllControl.PointSet.Count(); |
|
1245 |
// var NextP = (i + 1) % AllControl.PointSet.Count(); |
|
1246 |
|
|
1247 |
// var distance = MathSet.DistanceTo(AllControl.PointSet[ReverseP], AllControl.PointSet[i]); |
|
1248 |
|
|
1249 |
// var PreviousV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[PreviousP]); |
|
1250 |
// var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, |
|
1251 |
// AllControl.PointSet[i].Y - AllControl.PointSet[ReverseP].Y); |
|
1252 |
// AllControl.PointSet[PreviousP] = new Point(AllControl.PointSet[ReverseP].X + PreviousV.X * l, AllControl.PointSet |
|
1253 |
// [ReverseP].Y |
|
1254 |
// + PreviousV.Y * l); |
|
1255 |
|
|
1256 |
// var NextV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[NextP]); |
|
1257 |
// l = MathSet.DotProduct(NextV.X, NextV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, AllControl.PointSet |
|
1258 |
// [i].Y - AllControl.PointSet[ReverseP].Y); |
|
1259 |
// AllControl.PointSet[NextP] = new Point(AllControl.PointSet[ReverseP].X + NextV.X * l, AllControl.PointSet[ReverseP].Y + |
|
1260 |
// NextV.Y * l); |
|
1261 |
// AllControl.updateControl(); |
|
1262 |
// DynamicThumbUpdate(control); |
|
1263 |
// BorderUpdate(); |
|
1264 |
// } |
|
1265 |
// break; |
|
1107 |
break; |
|
1266 | 1108 |
#endregion |
1267 | 1109 |
#region Ink |
1268 | 1110 |
case ControlType.Ink: |
... | ... | |
1337 | 1179 |
IsTextAngle = true; |
1338 | 1180 |
else |
1339 | 1181 |
IsTextAngle = false; |
1340 |
|
|
1341 |
//System.Diagnostics.Debug.WriteLine("X축 : " + e.GetPosition(this).X + "LastRotateVerticalValue : " + LastRotateVerticalValue); |
|
1342 | 1182 |
LastRotateVerticalValue = e.GetPosition(this).X; |
1343 | 1183 |
} |
1344 | 1184 |
else |
1345 |
{ |
|
1346 |
//System.Diagnostics.Debug.WriteLine("e.GetPosition(this).X : " + e.GetPosition(this).X); |
|
1347 |
//System.Diagnostics.Debug.WriteLine("LastRotateHorizontalValue: " + LastRotateHorizontalValue); |
|
1348 |
|
|
1185 |
{ |
|
1349 | 1186 |
if (e.GetPosition(this).X > LastRotateHorizontalValue) |
1350 | 1187 |
{ |
1351 | 1188 |
RotateFlag = true; |
... | ... | |
1385 | 1222 |
DynamicThumbUpdate(e, item); |
1386 | 1223 |
} |
1387 | 1224 |
#endregion |
1388 |
//강인구 추가 Sign, check, Stamp |
|
1225 |
|
|
1389 | 1226 |
#region 써클 |
1390 | 1227 |
if (item.Drawingtype == ControlType.Circle || item.Drawingtype == ControlType.Sign || item.Drawingtype == ControlType.Symbol || item.Drawingtype == ControlType.Stamp) |
1391 | 1228 |
{ |
... | ... | |
1400 | 1237 |
#endregion |
1401 | 1238 |
#region 텍스트 |
1402 | 1239 |
if (item.Drawingtype == ControlType.TextControl) |
1403 |
{ |
|
1404 |
//Canvas.SetLeft((item.DrawingData as TextControl), Canvas.GetLeft((item.DrawingData as TextControl)) + e.HorizontalChange / 5); |
|
1405 |
//Canvas.SetTop((item.DrawingData as TextControl), Canvas.GetTop((item.DrawingData as TextControl)) + e.VerticalChange / 5); |
|
1406 |
//(item.DrawingData as TextControl).StartPoint = |
|
1407 |
//new Point(Canvas.GetLeft((item.DrawingData as TextControl)) + e.HorizontalChange / 5, Canvas.GetTop((item.DrawingData as TextControl)) + e.VerticalChange / 5); |
|
1408 |
//(item.DrawingData as TextControl).EndPoint = (item.DrawingData as TextControl).StartPoint; |
|
1409 |
|
|
1240 |
{ |
|
1410 | 1241 |
Point dx = MathSet.RotateAbout(new Point(0, 0), new Point(e.HorizontalChange, e.VerticalChange), trRotate.Angle); |
1411 | 1242 |
Canvas.SetLeft((item.DrawingData as TextControl), Canvas.GetLeft((item.DrawingData as TextControl)) + dx.X); |
1412 | 1243 |
Canvas.SetTop((item.DrawingData as TextControl), Canvas.GetTop((item.DrawingData as TextControl)) + dx.Y); |
1413 | 1244 |
(item.DrawingData as TextControl).StartPoint = |
1414 | 1245 |
new Point(Canvas.GetLeft((item.DrawingData as TextControl)) + e.HorizontalChange / 5, Canvas.GetTop((item.DrawingData as TextControl)) + e.VerticalChange / 5); |
1415 | 1246 |
(item.DrawingData as TextControl).EndPoint = (item.DrawingData as TextControl).StartPoint; |
1416 |
|
|
1417 |
//(item.DrawingData as TextControl).CanvasX = (item.DrawingData as TextControl).StartPoint.X; |
|
1418 |
//(item.DrawingData as TextControl).CanvasY = (item.DrawingData as TextControl).StartPoint.Y; |
|
1419 | 1247 |
} |
1420 | 1248 |
#endregion |
1421 | 1249 |
#region 날짜 |
1422 | 1250 |
if (item.Drawingtype == ControlType.Date) |
1423 | 1251 |
{ |
1424 |
DynamicThumbUpdate(e, item); |
|
1425 |
//Canvas.SetLeft((item.DrawingData as DateControl), Canvas.GetLeft((item.DrawingData as DateControl)) + e.HorizontalChange); |
|
1426 |
//Canvas.SetTop((item.DrawingData as DateControl), Canvas.GetTop((item.DrawingData as DateControl)) + e.VerticalChange); |
|
1427 |
//(item.DrawingData as DateControl).StartPoint = new Point(Canvas.GetLeft((item.DrawingData as DateControl)) |
|
1428 |
// + e.HorizontalChange, Canvas.GetTop((item.DrawingData as DateControl)) + e.VerticalChange); |
|
1429 |
//(item.DrawingData as DateControl).EndPoint = (item.DrawingData as DateControl).StartPoint; |
|
1430 |
//MessageBox.Show("잠시 정확도를 위해 막아두었습니다!"); |
|
1431 |
|
|
1432 |
|
|
1252 |
DynamicThumbUpdate(e, item); |
|
1433 | 1253 |
} |
1434 | 1254 |
#endregion |
1435 | 1255 |
#region 클라우드 |
... | ... | |
1441 | 1261 |
} |
1442 | 1262 |
#endregion |
1443 | 1263 |
#region 심볼 |
1444 |
//if (item.Drawingtype == MarkupType.Viewbox) |
|
1445 |
//{ |
|
1446 |
// DynamicThumbUpdate(e, item); |
|
1447 |
// BorderUpdate(); |
|
1448 |
//} |
|
1449 |
#endregion |
|
1450 |
#region 폴리곤확장 |
|
1451 |
//if (item.Drawingtype == MarkupType.PolygonEx) |
|
1452 |
//{ |
|
1453 |
// Point px = new Point(e.HorizontalChange, e.VerticalChange); |
|
1454 |
// List<StylusPointSet> StylusPointSet = (item.DrawingData as PolyControl).PointC; |
|
1455 |
// for (int i = 0; i < StylusPointSet.Count; i++) |
|
1456 |
// { |
|
1457 |
// List<Point> lstPoint = StylusPointSet[i].pointSet; |
|
1458 |
// for (int j = 0; j < lstPoint.Count; j++) |
|
1459 |
// { |
|
1460 |
// lstPoint[j] = new Point(lstPoint[j].X + px.X, lstPoint[j].Y + px.Y); |
|
1461 |
// } |
|
1462 |
// } |
|
1463 |
|
|
1464 |
// for (int i = 0; i < item.ThumbList.Count; i++) |
|
1465 |
// { |
|
1466 |
// Canvas.SetLeft(item.ThumbList[i], Canvas.GetLeft(item.ThumbList[i]) + px.X); |
|
1467 |
// Canvas.SetTop(item.ThumbList[i], Canvas.GetTop(item.ThumbList[i]) + px.Y); |
|
1468 |
// } |
|
1469 |
// (item.DrawingData as IPath).updateControl(); |
|
1470 |
// BorderUpdate(); |
|
1471 |
// //for (int i = 0; i < (item.DrawingData as PolyControl).PointC.Count(); i++) |
|
1472 |
// //{ |
|
1473 |
// // //(item.DrawingData as PolyControl).PointC[i] = MathSet.RotateAbout(CenterPoint, (item.DrawingData as PolyControl).PointC[i]., dDeltaAngle); |
|
1474 |
// // for (int j = 0; j < (item.DrawingData as PolyControl).PointC[i].pointSet.Count; j++) |
|
1475 |
// // { |
|
1476 |
// // (item.DrawingData as PolyControl).PointC[i].pointSet[j] = new Point { X = (item.DrawingData as PolyControl).PointC[i].pointSet[j].X + dx.X, Y = (item.DrawingData as PolyControl).PointC[i].pointSet[j].Y + dx.Y }; |
|
1477 |
// // Canvas.SetLeft(item.ThumbList[i], Canvas.GetLeft(item.ThumbList[i]) + dx.X); |
|
1478 |
// // Canvas.SetTop(item.ThumbList[i], Canvas.GetTop(item.ThumbList[i]) + dx.Y); |
|
1479 |
// // } |
|
1480 |
// //} |
|
1481 |
// //(item.DrawingData as IPath).updateControl(); |
|
1482 |
//} |
|
1264 |
|
|
1483 | 1265 |
#endregion |
1266 |
|
|
1484 | 1267 |
#region 폴리곤 |
1485 | 1268 |
if (item.Drawingtype == ControlType.PolygonControl) |
1486 | 1269 |
{ |
... | ... | |
1491 | 1274 |
#region 잉크 |
1492 | 1275 |
if (item.Drawingtype == ControlType.Ink) |
1493 | 1276 |
{ |
1494 |
//DynamicThumbUpdate(e, item); |
|
1495 |
//BorderUpdate(); |
|
1496 |
|
|
1497 | 1277 |
Point px = new Point(e.HorizontalChange, e.VerticalChange); |
1498 | 1278 |
List<StylusPointSet> StylusPointSet = (item.DrawingData as InkControl).PointC; |
1499 | 1279 |
for (int i = 0; i < StylusPointSet.Count; i++) |
... | ... | |
1524 | 1304 |
{ |
1525 | 1305 |
var AllControl = item.DrawingData as IPath; |
1526 | 1306 |
List<Point> point = AllControl.PointSet; |
1527 |
//for (int i = 0; i < AllControl.PointSet.Count(); i++) |
|
1528 | 1307 |
for (int i = 0; i < item.ThumbList.Count(); i++) |
1529 | 1308 |
{ |
1530 | 1309 |
if (item.DrawingData.GetType().Name == "ArrowTextControl") |
... | ... | |
1554 | 1333 |
var AllControl = item.DrawingData as IPath; |
1555 | 1334 |
List<Point> point = AllControl.PointSet; |
1556 | 1335 |
|
1557 |
//if (item.DrawingData as ArrowTextControl !=null) |
|
1558 |
//{ |
|
1559 |
// for (int i = 0; i < AllControl.PointSet.Count(); i++) |
|
1560 |
// { |
|
1561 |
// if ((MemberSet.First() as AdornerMember).ThumbList[1]d) |
|
1562 |
// { |
|
1563 |
|
|
1564 |
// } |
|
1565 |
// } |
|
1566 |
// List<Point> ps = new List<Point>(); |
|
1567 |
// var temp = (MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl; |
|
1568 |
// ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox))); //상단 |
|
1569 |
// ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight)); // 하단 |
|
1570 |
// ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2)); //좌단 |
|
1571 |
// ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2)); //우단 |
|
1572 |
|
|
1573 |
// var endP = MathSet.getNearPoint(ps, temp.MidPoint); |
|
1574 |
// var tempP = MathSet.getMiddlePoint(temp.StartPoint, endP); |
|
1575 |
// Canvas.SetLeft((MemberSet.First() as AdornerMember).ThumbList[1], tempP.X); |
|
1576 |
// Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y); |
|
1577 |
//} |
|
1578 |
//else |
|
1579 |
//{ |
|
1580 | 1336 |
for (int i = 0; i < AllControl.PointSet.Count(); i++) |
1581 | 1337 |
{ |
1582 | 1338 |
|
... | ... | |
1590 | 1346 |
if (!(item.DrawingData as ArrowTextControl).isTrans) //trans가 True인경우 |
1591 | 1347 |
{ |
1592 | 1348 |
List<Point> ps = new List<Point>(); |
1593 |
//강인구 수정 |
|
1594 |
//var temp = (MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl; |
|
1349 |
|
|
1595 | 1350 |
var temp = item.DrawingData as ArrowTextControl; |
1596 | 1351 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox))); //상단 |
1597 | 1352 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight)); // 하단 |
... | ... | |
1760 | 1515 |
{ |
1761 | 1516 |
case ControlType.TextControl: |
1762 | 1517 |
((TextControl)item.DrawingData).Angle = AngleValue; |
1763 |
//trRotate.Angle = AngleValue; |
|
1764 |
|
|
1518 |
|
|
1765 | 1519 |
RectangleGeometry Data = new RectangleGeometry |
1766 | 1520 |
{ |
1767 | 1521 |
Rect = new Rect() |
... | ... | |
1772 | 1526 |
Height = (item.DrawingData as TextControl).Base_TextBlock.ActualHeight / 2, |
1773 | 1527 |
} |
1774 | 1528 |
}; |
1775 |
//if ((firstCondition as TextControl).Angle != 0) |
|
1776 |
//{ |
|
1529 |
|
|
1777 | 1530 |
Point endPointV = new Point(Data.Bounds.Right, Data.Bounds.Bottom); |
1778 |
Point middle = MathSet.getMiddlePoint((item.DrawingData as TextControl).StartPoint, endPointV); |
|
1779 |
|
|
1780 |
|
|
1781 |
//AdornerBorder.RenderTransformOrigin = new Point(1, 1); |
|
1782 |
//AdornerBorder.RenderTransform = new RotateTransform() |
|
1783 |
//{ |
|
1784 |
// Angle = (member as TextControl).Angle * -1, |
|
1785 |
// CenterX = middle.X + ((member as TextControl) as FrameworkElement).ActualWidth /2, |
|
1786 |
// CenterY = middle.Y + ((member as TextControl) as FrameworkElement).ActualHeight /2, |
|
1787 |
//}; |
|
1531 |
Point middle = MathSet.getMiddlePoint((item.DrawingData as TextControl).StartPoint, endPointV); |
|
1788 | 1532 |
|
1789 | 1533 |
DragThumb.RenderTransformOrigin = new Point(0.0, 0.0); |
1790 | 1534 |
DragThumb.RenderTransform = new RotateTransform() |
1791 | 1535 |
{ |
1792 | 1536 |
Angle = (item.DrawingData as TextControl).Angle, |
1793 |
//CenterX = middle.X, |
|
1794 |
//CenterY = middle.Y, |
|
1537 |
|
|
1795 | 1538 |
}; |
1796 | 1539 |
|
1797 | 1540 |
AdornerBorder.RenderTransformOrigin = new Point(0.0, 0.0); |
1798 | 1541 |
AdornerBorder.RenderTransform = new RotateTransform() |
1799 | 1542 |
{ |
1800 | 1543 |
Angle = (item.DrawingData as TextControl).Angle, |
1801 |
//CenterX = middle.X, |
|
1802 |
//CenterY = middle.Y, |
|
1544 |
|
|
1803 | 1545 |
}; |
1804 | 1546 |
|
1805 | 1547 |
(item.DrawingData as TextControl).Base_Grid.RenderTransform = new RotateTransform() |
... | ... | |
1809 | 1551 |
|
1810 | 1552 |
BorderUpdate(); |
1811 | 1553 |
break; |
1812 |
//case ControlType.Viewbox: |
|
1813 |
// (item.DrawingData as IPath).updateControl(); |
|
1814 |
// ((IViewBox)item.DrawingData).Angle = AngleValue; |
|
1815 |
// BorderUpdate(); |
|
1816 |
// break; |
|
1817 |
case ControlType.Date: |
|
1818 |
//강인구 추가(2018.02.22) |
|
1554 |
|
|
1555 |
case ControlType.Date: |
|
1819 | 1556 |
((DateControl)item.DrawingData).Angle = AngleValue; |
1820 | 1557 |
(item.DrawingData as IPath).updateControl(); |
1821 |
BorderUpdate(); |
|
1822 |
//MessageBox.Show("잠시 정확도를 위해 막아두었습니다!"); |
|
1558 |
BorderUpdate(); |
|
1823 | 1559 |
break; |
1824 | 1560 |
case ControlType.ArrowMultiLine: |
1825 | 1561 |
case ControlType.ArcLine: |
... | ... | |
1846 | 1582 |
((ImgControl)item.DrawingData).Angle = AngleValue; |
1847 | 1583 |
(item.DrawingData as IPath).updateControl(); |
1848 | 1584 |
BorderUpdate(); |
1849 |
break; |
|
1850 |
//강인구 추가 |
|
1585 |
break; |
|
1851 | 1586 |
case ControlType.Sign: |
1852 | 1587 |
((SignControl)item.DrawingData).Angle = AngleValue; |
1853 | 1588 |
(item.DrawingData as IPath).updateControl(); |
1854 | 1589 |
BorderUpdate(); |
1855 | 1590 |
break; |
1856 |
//강인구 추가 |
|
1857 | 1591 |
case ControlType.Symbol: |
1858 | 1592 |
((SymControl)item.DrawingData).Angle = AngleValue; |
1859 | 1593 |
(item.DrawingData as IPath).updateControl(); |
1860 | 1594 |
BorderUpdate(); |
1861 | 1595 |
break; |
1862 |
//강인구 추가 |
|
1863 | 1596 |
case ControlType.Stamp: |
1864 | 1597 |
((SymControlN)item.DrawingData).Angle = AngleValue; |
1865 | 1598 |
(item.DrawingData as IPath).updateControl(); |
1866 | 1599 |
BorderUpdate(); |
1867 | 1600 |
break; |
1868 | 1601 |
case ControlType.PolygonControl: |
1869 |
//((IShapeControl)AllControl).Angle = AngleValue; |
|
1870 | 1602 |
(item.DrawingData as IPath).updateControl(); |
1871 | 1603 |
BorderUpdate(); |
1872 | 1604 |
break; |
1873 | 1605 |
case ControlType.PolygonCloud: |
1874 |
//((IShapeControl)AllControl).Angle = AngleValue; |
|
1875 | 1606 |
((ICloudControl)item.DrawingData).DrawingCloud(); |
1876 | 1607 |
(item.DrawingData as IPath).updateControl(); |
1877 | 1608 |
BorderUpdate(); |
... | ... | |
1883 | 1614 |
BorderUpdate(); |
1884 | 1615 |
break; |
1885 | 1616 |
case ControlType.Ink: |
1886 |
//((IShapeControl)AllControl).Angle = AngleValue; |
|
1887 | 1617 |
(item.DrawingData as IPath).updateControl(); |
1888 | 1618 |
BorderUpdate(); |
1889 | 1619 |
break; |
... | ... | |
1893 | 1623 |
} |
1894 | 1624 |
#endregion |
1895 | 1625 |
})); |
1896 |
//BorderUpdate(); |
|
1897 | 1626 |
} |
1898 | 1627 |
|
1899 | 1628 |
private void resize_MouseMove(object sender, MouseEventArgs e) |
1900 | 1629 |
{ |
1901 |
reSizePoint = e.GetPosition(this); |
|
1902 |
//Thumb thumb = sender as Thumb; |
|
1903 |
//if (this.isDragging && MemberSet.Count <= 1 && DraggerThumb == thumb) |
|
1904 |
////if (thumb.IsDragging && MemberSet.Count <= 1 && DraggerThumb == thumb) |
|
1905 |
////if (DraggerThumb == thumb) |
|
1906 |
//{ |
|
1907 |
// Point setPoint = e.GetPosition(this); |
|
1908 |
// Canvas.SetLeft(thumb, setPoint.X); |
|
1909 |
// Canvas.SetTop(thumb, setPoint.Y); |
|
1910 |
// AdornerMember control = (from userThumb in MemberSet |
|
1911 |
// where userThumb.ThumbList.Contains(thumb) |
|
1912 |
// select userThumb).FirstOrDefault(); |
|
1913 |
// Point nearPoint = new Point(0, 0); |
|
1914 |
// IPath AllControl = control.DrawingData as IPath; |
|
1915 |
// if (ControlType.TextControl != control.Drawingtype) |
|
1916 |
// { |
|
1917 |
|
|
1918 |
// var temp = (MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl; |
|
1919 |
// List<Point> ps = new List<Point>(); |
|
1920 |
|
|
1921 |
// nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
1922 |
// //switch (Math.Abs(temp.Angle).ToString()) |
|
1923 |
// //{ |
|
1924 |
|
|
1925 |
// // case "90": |
|
1926 |
// // { |
|
1927 |
// // nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
1928 |
// // } |
|
1929 |
// // break; |
|
1930 |
// // case "270": |
|
1931 |
// // { |
|
1932 |
// // nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
1933 |
// // } |
|
1934 |
// // break; |
|
1935 |
// // default: |
|
1936 |
// // { |
|
1937 |
// // nearPoint = MathSet.getNearPoint((control.DrawingData as IPath).PointSet, setPoint); |
|
1938 |
// // } |
|
1939 |
// // break; |
|
1940 |
// //} |
|
1941 |
|
|
1942 |
// } |
|
1943 |
// for (int i = 0; i < (control.DrawingData as IPath).PointSet.Count; i++) |
|
1944 |
// { |
|
1945 |
// switch (control.Drawingtype) |
|
1946 |
// { |
|
1947 |
// #region Arc + Line |
|
1948 |
// case ControlType.ArcLine: |
|
1949 |
// case ControlType.SingleLine: |
|
1950 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
1951 |
// { |
|
1952 |
// AllControl.PointSet[i] = setPoint; |
|
1953 |
// AllControl.updateControl(); |
|
1954 |
// DynamicThumbUpdate(control); |
|
1955 |
// BorderUpdate(); |
|
1956 |
|
|
1957 |
// //if (control.DrawingData.GetType().Name == "ArrowTextControl") |
|
1958 |
// //{ |
|
1959 |
// // Thumb tm = control.ThumbList.Last(); |
|
1960 |
// // //Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width / 2)); |
|
1961 |
// // //Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height / 2)); |
|
1962 |
// // Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width)); |
|
1963 |
// // Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height)); |
|
1964 |
// //} |
|
1965 |
// } |
|
1966 |
// break; |
|
1967 |
// #endregion |
|
1968 |
// #region Shape |
|
1969 |
// case ControlType.Rectangle: |
|
1970 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
1971 |
// { |
|
1972 |
// AllControl.PointSet[i] = setPoint; |
|
1973 |
// var ReverseP = (i + AllControl.PointSet.Count() / 2) % AllControl.PointSet.Count(); |
|
1974 |
// var PreviousP = (i + (AllControl.PointSet.Count() - 1)) % AllControl.PointSet.Count(); |
|
1975 |
// var NextP = (i + 1) % AllControl.PointSet.Count(); |
|
1976 |
|
|
1977 |
// var distance = MathSet.DistanceTo(AllControl.PointSet[ReverseP], AllControl.PointSet[i]); |
|
1978 |
|
|
1979 |
// var PreviousV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[PreviousP]); |
|
1980 |
// var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, |
|
1981 |
// AllControl.PointSet[i].Y - AllControl.PointSet[ReverseP].Y); |
|
1982 |
// AllControl.PointSet[PreviousP] = new Point(AllControl.PointSet[ReverseP].X + PreviousV.X * l, AllControl.PointSet |
|
1983 |
// [ReverseP].Y |
|
1984 |
// + PreviousV.Y * l); |
|
1985 |
|
|
1986 |
// var NextV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[NextP]); |
|
1987 |
// l = MathSet.DotProduct(NextV.X, NextV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, AllControl.PointSet |
|
1988 |
// [i].Y - AllControl.PointSet[ReverseP].Y); |
|
1989 |
// AllControl.PointSet[NextP] = new Point(AllControl.PointSet[ReverseP].X + NextV.X * l, AllControl.PointSet[ReverseP].Y + |
|
1990 |
// NextV.Y * l); |
|
1991 |
// AllControl.updateControl(); |
|
1992 |
// DynamicThumbUpdate(control); |
|
1993 |
// BorderUpdate(); |
|
1994 |
// } |
|
1995 |
// break; |
|
1996 |
// #endregion |
|
1997 |
// #region Polygon |
|
1998 |
// case ControlType.PolygonControl: |
|
1999 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
2000 |
// { |
|
2001 |
// AllControl.PointSet[i] = setPoint; |
|
2002 |
// AllControl.updateControl(); |
|
2003 |
// BorderUpdate(); |
|
2004 |
// } |
|
2005 |
// break; |
|
2006 |
// #endregion |
|
2007 |
// #region Cicle |
|
2008 |
// case ControlType.Circle: |
|
2009 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
2010 |
// { |
|
2011 |
// AllControl.PointSet[i] = setPoint; |
|
2012 |
// List<Point> newPointSet = new List<Point> { }; |
|
2013 |
// Point middle = new Point(AllControl.PathData.Bounds.X + AllControl.PathData.Bounds.Width * 0.5, |
|
2014 |
// AllControl.PathData.Bounds.Y + |
|
2015 |
// AllControl.PathData.Bounds.Height * 0.5); |
|
2016 |
// foreach (Point pt in AllControl.PointSet) |
|
2017 |
// { |
|
2018 |
// newPointSet.Add(pt); |
|
2019 |
// } |
|
2020 |
// var ReverseP = (i + newPointSet.Count() / 2) % newPointSet.Count(); |
|
2021 |
// var PreviousP = (i + (newPointSet.Count() - 1)) % newPointSet.Count(); |
|
2022 |
// var NextP = (i + 1) % newPointSet.Count(); |
|
2023 |
// var distance = MathSet.DistanceTo(newPointSet[ReverseP], newPointSet[i]); |
|
2024 |
// var PreviousV = MathSet.GetNormVectorBetween(newPointSet[ReverseP], newPointSet[PreviousP]); |
|
2025 |
// var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, newPointSet[i].X - newPointSet[ReverseP].X, |
|
2026 |
// newPointSet[i].Y - newPointSet[ReverseP].Y); |
|
2027 |
// newPointSet[PreviousP] = new Point(newPointSet[ReverseP].X + PreviousV.X * l, newPointSet[ReverseP].Y |
|
2028 |
// + PreviousV.Y * l); |
|
2029 |
|
|
2030 |
// var NextV = MathSet.GetNormVectorBetween(newPointSet[ReverseP], newPointSet[NextP]); |
|
2031 |
// l = MathSet.DotProduct(NextV.X, NextV.Y, newPointSet[i].X - newPointSet[ReverseP].X, newPointSet[i].Y |
|
2032 |
// - newPointSet[ReverseP].Y); |
|
2033 |
// newPointSet[NextP] = new Point(newPointSet[ReverseP].X + NextV.X * l, newPointSet[ReverseP].Y + NextV.Y * l); |
|
2034 |
|
|
2035 |
// AllControl.PointSet = newPointSet; |
|
2036 |
// DynamicThumbUpdate(control); |
|
2037 |
// AllControl.updateControl(); |
|
2038 |
// BorderUpdate(); |
|
2039 |
// } |
|
2040 |
// break; |
|
2041 |
// #endregion |
|
2042 |
// #region ArrowText |
|
2043 |
// case ControlType.ArrowTextControl: |
|
2044 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
2045 |
// { |
|
2046 |
// AllControl.PointSet[i] = setPoint; |
|
2047 |
// AllControl.updateControl(); |
|
2048 |
|
|
2049 |
// DynamicThumbUpdate(control); |
|
2050 |
// BorderUpdate(); |
|
2051 |
|
|
2052 |
// //if (control.DrawingData.GetType().Name == "ArrowTextControl") |
|
2053 |
// //{ |
|
2054 |
// // Thumb tm = control.ThumbList.Last(); |
|
2055 |
// // //Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width / 2)); |
|
2056 |
// // //Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height / 2)); |
|
2057 |
// // Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width)); |
|
2058 |
// // Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height)); |
|
2059 |
// //} |
|
2060 |
// } |
|
2061 |
// break; |
|
2062 |
// #endregion |
|
2063 |
// #region Text |
|
2064 |
// case ControlType.TextControl: |
|
2065 |
// break; |
|
2066 |
// #endregion |
|
2067 |
// #region Image |
|
2068 |
// case ControlType.ImgControl: |
|
2069 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
2070 |
// { |
|
2071 |
// AllControl.PointSet[i] = setPoint; |
|
2072 |
// var ReverseP = (i + AllControl.PointSet.Count() / 2) % AllControl.PointSet.Count(); |
|
2073 |
// var PreviousP = (i + (AllControl.PointSet.Count() - 1)) % AllControl.PointSet.Count(); |
|
2074 |
// var NextP = (i + 1) % AllControl.PointSet.Count(); |
|
2075 |
|
|
2076 |
// var distance = MathSet.DistanceTo(AllControl.PointSet[ReverseP], AllControl.PointSet[i]); |
|
2077 |
|
|
2078 |
// var PreviousV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[PreviousP]); |
|
2079 |
// var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, |
|
2080 |
// AllControl.PointSet[i].Y - AllControl.PointSet[ReverseP].Y); |
|
2081 |
// AllControl.PointSet[PreviousP] = new Point(AllControl.PointSet[ReverseP].X + PreviousV.X * l, AllControl.PointSet |
|
2082 |
// [ReverseP].Y |
|
2083 |
// + PreviousV.Y * l); |
|
2084 |
|
|
2085 |
// var NextV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[NextP]); |
|
2086 |
// l = MathSet.DotProduct(NextV.X, NextV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, AllControl.PointSet |
|
2087 |
// [i].Y - AllControl.PointSet[ReverseP].Y); |
|
2088 |
// AllControl.PointSet[NextP] = new Point(AllControl.PointSet[ReverseP].X + NextV.X * l, AllControl.PointSet[ReverseP].Y + |
|
2089 |
// NextV.Y * l); |
|
2090 |
// AllControl.updateControl(); |
|
2091 |
// DynamicThumbUpdate(control); |
|
2092 |
// BorderUpdate(); |
|
2093 |
// } |
|
2094 |
// break; |
|
2095 |
// #endregion |
|
2096 |
// #region Cloud |
|
2097 |
// case ControlType.PolygonCloud: |
|
2098 |
// if (nearPoint.Equals(AllControl.PointSet[i])) |
|
2099 |
// { |
|
2100 |
// AllControl.PointSet[i] = setPoint; |
|
2101 |
// AllControl.updateControl(); |
|
2102 |
// ((ICloudControl)AllControl).DrawingCloud(); |
|
2103 |
// BorderUpdate(); |
|
2104 |
// } |
|
2105 |
// break; |
|
2106 |
// #endregion |
|
2107 |
// #region SymBol |
|
2108 |
// //case MarkupType.Viewbox: |
|
2109 |
// // if (nearPoint.Equals(AllControl.PointSet[i])) |
|
2110 |
// // { |
|
2111 |
// // AllControl.PointSet[i] = setPoint; |
|
2112 |
// // var ReverseP = (i + AllControl.PointSet.Count() / 2) % AllControl.PointSet.Count(); |
|
2113 |
// // var PreviousP = (i + (AllControl.PointSet.Count() - 1)) % AllControl.PointSet.Count(); |
|
2114 |
// // var NextP = (i + 1) % AllControl.PointSet.Count(); |
|
2115 |
|
|
2116 |
// // var distance = MathSet.DistanceTo(AllControl.PointSet[ReverseP], AllControl.PointSet[i]); |
|
2117 |
|
|
2118 |
// // var PreviousV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[PreviousP]); |
|
2119 |
// // var l = MathSet.DotProduct(PreviousV.X, PreviousV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, |
|
2120 |
// // AllControl.PointSet[i].Y - AllControl.PointSet[ReverseP].Y); |
|
2121 |
// // AllControl.PointSet[PreviousP] = new Point(AllControl.PointSet[ReverseP].X + PreviousV.X * l, AllControl.PointSet |
|
2122 |
// // [ReverseP].Y |
|
2123 |
// // + PreviousV.Y * l); |
|
2124 |
|
|
2125 |
// // var NextV = MathSet.GetNormVectorBetween(AllControl.PointSet[ReverseP], AllControl.PointSet[NextP]); |
|
2126 |
// // l = MathSet.DotProduct(NextV.X, NextV.Y, AllControl.PointSet[i].X - AllControl.PointSet[ReverseP].X, AllControl.PointSet |
|
2127 |
// // [i].Y - AllControl.PointSet[ReverseP].Y); |
|
2128 |
// // AllControl.PointSet[NextP] = new Point(AllControl.PointSet[ReverseP].X + NextV.X * l, AllControl.PointSet[ReverseP].Y + |
|
2129 |
// // NextV.Y * l); |
|
2130 |
// // AllControl.updateControl(); |
|
2131 |
// // DynamicThumbUpdate(control); |
|
2132 |
// // BorderUpdate(); |
|
2133 |
// // } |
|
2134 |
// // break; |
|
2135 |
// #endregion |
|
2136 |
// default: |
|
2137 |
// break; |
|
2138 |
// } |
|
2139 |
// } |
|
2140 |
//} |
|
1630 |
reSizePoint = e.GetPosition(this); |
|
2141 | 1631 |
} |
2142 | 1632 |
/// <summary> |
2143 | 1633 |
/// 회전 |
... | ... | |
2166 | 1656 |
|
2167 | 1657 |
List<Point> AllPointSet = new List<Point>(); |
2168 | 1658 |
Point CenterPoint = new Point(); |
2169 |
#region 회전율에 따른 DragDelta 값 |
|
2170 |
|
|
2171 |
#region 원본소스 |
|
2172 |
////if (Math.Abs(e.HorizontalChange) > Math.Abs(e.VerticalChange)) |
|
2173 |
////{ |
|
2174 |
// //dDeltaAngle = +2; |
|
2175 |
// //dDeltaAngle = (e.HorizontalChange / 20); |
|
2176 |
// AngleValue = AngleValue + dDeltaAngle; |
|
2177 |
// if (Math.Abs(e.HorizontalChange) > Math.Abs(e.VerticalChange)) |
|
2178 |
// { |
|
2179 |
// if (LastRotateHorizontalValue < e.HorizontalChange) |
|
2180 |
// { |
|
2181 |
// dDeltaAngle = 2; |
|
2182 |
// AngleValue = AngleValue + dDeltaAngle; |
|
2183 |
// } |
|
2184 |
// else |
|
2185 |
// { |
|
2186 |
// dDeltaAngle = -2; |
|
2187 |
// AngleValue = AngleValue + dDeltaAngle; |
|
2188 |
// } |
|
2189 |
// } |
|
2190 |
// //else |
|
2191 |
// //{ |
|
2192 |
// // if (LastRotateVerticalValue < e.VerticalChange) |
|
2193 |
// // { |
|
2194 |
// // dDeltaAngle = -2; |
|
2195 |
// // AngleValue = AngleValue + dDeltaAngle; |
|
2196 |
|
|
2197 |
// // } |
|
2198 |
// // else |
|
2199 |
// // { |
|
2200 |
// // dDeltaAngle = 2; |
|
2201 |
// // AngleValue = AngleValue + dDeltaAngle; |
|
2202 |
// // } |
|
2203 |
// //} |
|
2204 |
////} |
|
2205 |
////else if (Math.Abs(e.HorizontalChange) < Math.Abs(e.VerticalChange)) |
|
2206 |
////{ |
|
2207 |
//// //dDeltaAngle = (e.VerticalChange / 20); |
|
2208 |
//// dDeltaAngle = -2; |
|
2209 |
//// AngleValue = AngleValue + dDeltaAngle; |
|
2210 |
////} |
|
2211 |
#endregion |
|
2212 |
|
|
2213 |
//강인구 수정 |
|
2214 |
//AngleValue = AngleValue + dDeltaAngle; |
|
2215 |
#endregion |
|
2216 |
|
|
1659 |
|
|
2217 | 1660 |
#region 센터 포인트 구하기 (그룹핑) |
2218 | 1661 |
foreach (var item in MemberSet) |
2219 | 1662 |
{ |
2220 | 1663 |
if (item.DrawingData.GetType().Name == "TextControl") |
2221 |
{ |
|
2222 |
//if (AngleValue == 0) |
|
2223 |
//{ |
|
2224 |
// AngleValue = (item.DrawingData as TextControl).Angle; |
|
2225 |
//} |
|
2226 |
//double X = Canvas.GetLeft((item.DrawingData as TextControl)); |
|
2227 |
//double Y = Canvas.GetTop((item.DrawingData as TextControl)); |
|
2228 |
//AllPointSet.Add(new Point(X,Y)); |
|
1664 |
{ |
|
2229 | 1665 |
if (AngleValue == 0) |
2230 | 1666 |
{ |
2231 | 1667 |
AngleValue = (item.DrawingData as TextControl).Angle; |
... | ... | |
2246 | 1682 |
CenterPoint = MathSet.FindCentroid(AllPointSet); |
2247 | 1683 |
Point pt = Mouse.GetPosition(this); |
2248 | 1684 |
|
2249 |
|
|
2250 |
|
|
2251 |
|
|
2252 |
//if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name != "TextControl") |
|
2253 |
//{ |
|
2254 | 1685 |
Point vec1 = new Point(this.rotatePoint.X - CenterPoint.X, this.rotatePoint.Y - CenterPoint.Y); |
2255 | 1686 |
Point vec2 = new Point(pt.X - CenterPoint.X, pt.Y - CenterPoint.Y); |
2256 | 1687 |
dDeltaAngle = (MathSet.getAngleBetweenVectors(vec1, vec2)); |
2257 | 1688 |
|
2258 |
System.Diagnostics.Debug.WriteLine("vec1 : " + vec1.X + "/" + vec1.Y); |
|
2259 |
System.Diagnostics.Debug.WriteLine("vec2 : " + vec2.X + "/" + vec2.Y); |
|
2260 |
System.Diagnostics.Debug.WriteLine("dDeltaAngle : " + dDeltaAngle); |
|
2261 |
|
|
2262 |
//} |
|
2263 |
//else |
|
2264 |
//{ |
|
2265 |
//if (IsTextAngle || RotateFlag) |
|
2266 |
//{ |
|
2267 |
// AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle + 5; |
|
2268 |
//} |
|
2269 |
//else |
|
2270 |
//{ |
|
2271 |
// AngleValue = ((MemberSet.First() as AdornerMember).DrawingData as TextControl).Angle - 5; |
|
2272 |
//} |
|
2273 |
//} |
|
1689 |
//System.Diagnostics.Debug.WriteLine("vec1 : " + vec1.X + "/" + vec1.Y); |
|
1690 |
//System.Diagnostics.Debug.WriteLine("vec2 : " + vec2.X + "/" + vec2.Y); |
|
1691 |
//System.Diagnostics.Debug.WriteLine("dDeltaAngle : " + dDeltaAngle); |
|
2274 | 1692 |
|
2275 | 1693 |
AngleValue += dDeltaAngle; |
2276 | 1694 |
if (AngleValue > 360) AngleValue -= 360; |
... | ... | |
2288 | 1706 |
|
2289 | 1707 |
Point value = MathSet.RotateAbout(CenterPoint, new Point(x, y), dDeltaAngle); |
2290 | 1708 |
Canvas.SetLeft(thumb, value.X); |
2291 |
Canvas.SetTop(thumb, value.Y); |
|
2292 |
|
|
2293 |
/*if (item.DrawingData.GetType().Name == "ArrowTextControl" && thumb == item.ThumbList.Last()) |
|
2294 |
{ |
|
2295 |
Canvas.SetLeft(thumb, Canvas.GetLeft((item.DrawingData as ArrowTextControl).Base_TextBox)); |
|
2296 |
Canvas.SetTop(thumb, Canvas.GetTop((item.DrawingData as ArrowTextControl).Base_TextBox)); |
|
2297 |
if (!(item.DrawingData as ArrowTextControl).isTrans) |
|
2298 |
{ |
|
2299 |
List<Point> ps = new List<Point>(); |
|
2300 |
|
|
2301 |
//강인구 추가 |
|
2302 |
//var temp = (MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl; |
|
2303 |
var temp = item.DrawingData as ArrowTextControl; |
|
2304 |
switch (Math.Abs(temp.Angle).ToString()) |
|
2305 |
{ |
|
2306 |
case "90": |
|
2307 |
{ |
|
2308 |
ps.Clear(); |
|
2309 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox))); //위 왼쪽 |
|
2310 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth / 2)); // 위 중간 |
|
2311 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth)); // 위 오른쪽 |
|
2312 |
|
|
2313 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 중간 |
|
2314 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 하단 |
|
2315 |
|
|
2316 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth / 2)); //중간 하단 |
|
2317 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth)); //오른쪽 하단 |
|
2318 |
|
|
2319 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox) - temp.BoxWidth)); //오른쪽 중간 |
|
2320 |
} |
|
2321 |
break; |
|
2322 |
case "270": |
|
2323 |
{ |
|
2324 |
ps.Clear(); |
|
2325 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox))); //위 왼쪽 |
|
2326 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth / 2)); // 위 중간 |
|
2327 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth)); // 위 오른쪽 |
|
2328 |
|
|
2329 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 중간 |
|
2330 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox))); //왼쪽 하단 |
|
2331 |
|
|
2332 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth / 2)); //중간 하단 |
|
2333 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight, Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth)); //오른쪽 하단 |
|
2334 |
|
|
2335 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) - temp.BoxHeight / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxWidth)); //오른쪽 중간 |
|
2336 |
} |
|
2337 |
break; |
|
2338 |
default: |
|
2339 |
{ |
|
2340 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox))); //상단 |
|
2341 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth / 2, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight)); // 하단 |
|
2342 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox), Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2)); //좌단 |
|
2343 |
ps.Add(new Point(Canvas.GetLeft(temp.Base_TextBox) + temp.BoxWidth, Canvas.GetTop(temp.Base_TextBox) + temp.BoxHeight / 2)); //우단 |
|
2344 |
} |
|
2345 |
break; |
|
2346 |
} |
|
2347 |
|
|
2348 |
var endP = MathSet.getNearPoint(ps, temp.MidPoint); |
|
2349 |
var tempP = MathSet.getMiddlePoint(temp.StartPoint, endP); |
|
2350 |
|
|
2351 |
Canvas.SetLeft((MemberSet.Where(data => data.DrawingData.GetType().Name == "ArrowTextControl")).FirstOrDefault().ThumbList[1], tempP.X); |
|
2352 |
Canvas.SetTop((MemberSet.Where(data => data.DrawingData.GetType().Name == "ArrowTextControl")).FirstOrDefault().ThumbList[1], tempP.Y); |
|
2353 |
//Canvas.SetLeft((MemberSet.First() as AdornerMember).ThumbList[1], tempP.X); |
|
2354 |
//Canvas.SetTop((MemberSet.First() as AdornerMember).ThumbList[1], tempP.Y); |
|
2355 |
} |
|
2356 |
}*/ |
|
1709 |
Canvas.SetTop(thumb, value.Y); |
|
2357 | 1710 |
} |
2358 | 1711 |
|
2359 | 1712 |
for (int i = 0; i < (item.DrawingData as IPath).PointSet.Count(); i++) |
... | ... | |
2368 | 1721 |
{ |
2369 | 1722 |
case ControlType.TextControl: |
2370 | 1723 |
((TextControl)item.DrawingData).Angle = AngleValue; |
2371 |
//trRotate.Angle = AngleValue; |
|
2372 |
|
|
1724 |
|
|
2373 | 1725 |
RectangleGeometry Data = new RectangleGeometry |
2374 | 1726 |
{ |
2375 | 1727 |
Rect = new Rect() |
... | ... | |
2380 | 1732 |
Height = (item.DrawingData as TextControl).Base_TextBlock.ActualHeight / 2, |
2381 | 1733 |
} |
2382 | 1734 |
}; |
2383 |
//if ((firstCondition as TextControl).Angle != 0) |
|
2384 |
//{ |
|
1735 |
|
|
2385 | 1736 |
Point endPointV = new Point(Data.Bounds.Right, Data.Bounds.Bottom); |
2386 | 1737 |
Point middle = MathSet.getMiddlePoint((item.DrawingData as TextControl).StartPoint, endPointV); |
2387 |
|
|
2388 |
|
|
2389 |
//AdornerBorder.RenderTransformOrigin = new Point(1, 1); |
|
2390 |
//AdornerBorder.RenderTransform = new RotateTransform() |
|
2391 |
//{ |
|
2392 |
// Angle = (member as TextControl).Angle * -1, |
|
2393 |
// CenterX = middle.X + ((member as TextControl) as FrameworkElement).ActualWidth /2, |
|
2394 |
// CenterY = middle.Y + ((member as TextControl) as FrameworkElement).ActualHeight /2, |
|
2395 |
//}; |
|
2396 |
|
|
2397 |
|
|
1738 |
|
|
2398 | 1739 |
DragThumb.RenderTransformOrigin = new Point(0, 0); |
2399 | 1740 |
DragThumb.RenderTransform = new RotateTransform() |
2400 | 1741 |
{ |
... | ... | |
2418 | 1759 |
|
2419 | 1760 |
BorderUpdate(); |
2420 | 1761 |
break; |
2421 |
//case ControlType.Viewbox: |
|
2422 |
// (item.DrawingData as IPath).updateControl(); |
|
2423 |
// ((IViewBox)item.DrawingData).Angle = AngleValue; |
|
2424 |
// BorderUpdate(); |
|
2425 |
// break; |
|
1762 |
|
|
2426 | 1763 |
case ControlType.Date: |
2427 |
|
|
2428 |
//강인구 추가(2018.02.22) |
|
2429 | 1764 |
((DateControl)item.DrawingData).Angle = AngleValue; |
2430 | 1765 |
(item.DrawingData as IPath).updateControl(); |
2431 |
|
|
2432 |
BorderUpdate(); |
|
2433 |
//MessageBox.Show("잠시 정확도를 위해 막아두었습니다!"); |
|
1766 |
BorderUpdate(); |
|
2434 | 1767 |
break; |
2435 | 1768 |
case ControlType.ArrowMultiLine: |
2436 | 1769 |
case ControlType.ArcLine: |
... | ... | |
2457 | 1790 |
((ImgControl)item.DrawingData).Angle = AngleValue; |
2458 | 1791 |
(item.DrawingData as IPath).updateControl(); |
2459 | 1792 |
BorderUpdate(); |
2460 |
break; |
|
2461 |
//강인구 추가 |
|
1793 |
break; |
|
2462 | 1794 |
case ControlType.Sign: |
2463 | 1795 |
((SignControl)item.DrawingData).Angle = AngleValue; |
2464 | 1796 |
(item.DrawingData as IPath).updateControl(); |
2465 | 1797 |
BorderUpdate(); |
2466 |
break; |
|
2467 |
//강인구 추가 |
|
1798 |
break; |
|
2468 | 1799 |
case ControlType.Symbol: |
2469 | 1800 |
((SymControl)item.DrawingData).Angle = AngleValue; |
2470 | 1801 |
(item.DrawingData as IPath).updateControl(); |
2471 | 1802 |
BorderUpdate(); |
2472 | 1803 |
break; |
2473 |
//강인구 추가 |
|
2474 | 1804 |
case ControlType.Stamp: |
2475 | 1805 |
((SymControlN)item.DrawingData).Angle = AngleValue; |
2476 | 1806 |
(item.DrawingData as IPath).updateControl(); |
2477 | 1807 |
BorderUpdate(); |
2478 | 1808 |
break; |
2479 | 1809 |
case ControlType.PolygonControl: |
2480 |
//((IShapeControl)AllControl).Angle = AngleValue; |
|
2481 | 1810 |
(item.DrawingData as IPath).updateControl(); |
2482 | 1811 |
BorderUpdate(); |
2483 | 1812 |
break; |
2484 | 1813 |
case ControlType.PolygonCloud: |
2485 |
//((IShapeControl)AllControl).Angle = AngleValue; |
|
2486 | 1814 |
((ICloudControl)item.DrawingData).DrawingCloud(); |
2487 | 1815 |
(item.DrawingData as IPath).updateControl(); |
2488 | 1816 |
BorderUpdate(); |
... | ... | |
2504 | 1832 |
(item.DrawingData as IPath).updateControl(); |
2505 | 1833 |
BorderUpdate(); |
2506 | 1834 |
break; |
2507 |
//case MarkupType.PolygonEx: |
|
2508 |
// //trRotate.Angle = AngleValue; |
|
2509 |
// for (int i = 0; i < (item.DrawingData as PolyControl).PointC.Count(); i++) |
|
2510 |
// { |
|
2511 |
// //(item.DrawingData as PolyControl).PointC[i] = MathSet.RotateAbout(CenterPoint, (item.DrawingData as PolyControl).PointC[i]., dDeltaAngle); |
|
2512 |
// for (int j = 0; j < (item.DrawingData as PolyControl).PointC[i].pointSet.Count; j++) |
|
2513 |
// { |
|
2514 |
// (item.DrawingData as PolyControl).PointC[i].pointSet[j] = MathSet.RotateAbout(CenterPoint, (item.DrawingData as PolyControl).PointC[i].pointSet[j], dDeltaAngle); |
|
2515 |
// } |
|
2516 |
// } |
|
2517 |
// (item.DrawingData as IPath).updateControl(); |
|
2518 |
// BorderUpdate(); |
|
2519 |
// break; |
|
1835 |
|
|
2520 | 1836 |
default: |
2521 | 1837 |
break; |
2522 | 1838 |
} |
... | ... | |
2527 | 1843 |
} |
2528 | 1844 |
|
2529 | 1845 |
private void rotate_DragStarted(object sender, DragStartedEventArgs e) |
2530 |
{ |
|
2531 |
////System.Windows.Forms.Cursor.Position = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X - 150, System.Windows.Forms.Cursor.Position.Y - 150); |
|
2532 |
//this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
|
2533 |
//rotateTop.Cursor = Cursors.SizeAll; |
|
2534 |
|
|
2535 |
////CustomCursor.SetCursorTemplate(rotateTop, this.Resources["AnimatedCursor"] as DataTemplate); |
|
2536 |
////rotateTop.Cursor = Cursors.None; |
|
2537 |
|
|
2538 |
////if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().PointSet != null) |
|
2539 |
////{ |
|
2540 |
//// return; |
|
2541 |
////} |
|
1846 |
{ |
|
2542 | 1847 |
|
2543 | 1848 |
this.rotatePoint = Mouse.GetPosition(this); /// 2018.05.09 added by humkyung |
2544 | 1849 |
rotateTop.Cursor = Cursors.SizeAll; |
... | ... | |
2577 | 1882 |
|
2578 | 1883 |
private void rotate_DragCompleted(object sender, DragCompletedEventArgs e) |
2579 | 1884 |
{ |
2580 |
//CustomCursor.SetCursorTemplate(rotateTop, null); |
|
2581 | 1885 |
rotateTop.Cursor = Cursors.Arrow; |
2582 | 1886 |
|
2583 | 1887 |
Undo_Event(); |
... | ... | |
2653 | 1957 |
} |
2654 | 1958 |
|
2655 | 1959 |
private void drag_DragCompleted(object sender, DragCompletedEventArgs e) |
2656 |
{ |
|
2657 |
//CustomCursor.SetCursorTemplate(DragThumb, null); |
|
1960 |
{ |
|
2658 | 1961 |
DragThumb.Cursor = Cursors.Arrow; |
2659 | 1962 |
|
2660 | 1963 |
Undo_Event(); |
... | ... | |
2719 | 2022 |
|
2720 | 2023 |
if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "TextControl") |
2721 | 2024 |
{ |
2722 |
TextControlChanger(); |
|
2723 |
// TextControl AllControl = (MemberSet.First() as AdornerMember).DrawingData as TextControl; |
|
2724 |
// AllControl.Base_TextBox.Focus(); |
|
2725 |
// AllControl.Base_TextBox.Visibility = Visibility.Visible; |
|
2726 |
// AllControl.Base_TextBlock.Visibility = Visibility.Collapsed; |
|
2727 |
// AllControl.Base_TextBox.Focus(); |
|
2728 |
// AllControl.SizeChanged += (sen, ea) => |
|
2729 |
// { |
|
2730 |
// if (AllControl.Base_TextBox != null) |
|
2731 |
// { |
|
2732 |
// RectangleGeometry Data = new RectangleGeometry |
|
2733 |
// { |
|
2734 |
// Rect = new Rect() |
|
2735 |
// { |
|
2736 |
// X = AllControl.StartPoint.X, |
|
2737 |
// Y = AllControl.StartPoint.Y, |
|
2738 |
// Width = AllControl.Base_TextBox.Width, |
|
2739 |
// Height = AllControl.Base_TextBox.Height, |
|
2740 |
// } |
|
2741 |
// }; |
|
2742 |
|
|
2743 |
// Point endPointV = new Point(Data.Bounds.Right, Data.Bounds.Bottom); |
|
2744 |
// Point middle = MathSet.getMiddlePoint(AllControl.StartPoint, endPointV); |
|
2745 |
// AllControl.Base_Grid.RenderTransform = new RotateTransform() |
|
2746 |
// { |
|
2747 |
// Angle = AllControl.Angle, |
|
2748 |
// CenterX = middle.X, |
|
2749 |
// CenterY = middle.Y, |
|
2750 |
// }; |
|
2751 |
// } |
|
2752 |
// BorderUpdate(); |
|
2753 |
// }; |
|
2025 |
TextControlChanger(); |
|
2754 | 2026 |
} |
2755 | 2027 |
|
2756 | 2028 |
else if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "ArrowTextControl") |
... | ... | |
2759 | 2031 |
Thumb tm = (MemberSet.First() as AdornerMember).ThumbList.Last(); |
2760 | 2032 |
((ArrowTextControl)AllControl).Base_TextBox.Focus(); |
2761 | 2033 |
|
2762 |
//강인구 추가(ArrowControl TextBox Thumb없애기
|
|
2034 |
//ArrowControl TextBox Thumb없애기 |
|
2763 | 2035 |
tm.Visibility = Visibility.Collapsed; |
2764 | 2036 |
|
2765 | 2037 |
((MemberSet.First() as AdornerMember).DrawingData as ArrowTextControl).Base_TextBox.IsHitTestVisible = true; |
2766 |
|
|
2767 |
//(sender as System.Windows.Shapes.Rectangle).IsHitTestVisible = false; |
|
2768 |
//(sender as System.Windows.Shapes.Rectangle).Visibility = Visibility.Hidden; |
|
2769 |
//Canvas.SetZIndex(((ArrowTextControl)AllControl).Base_TextBox,9999); |
|
2770 |
//editTextBox = ((ArrowTextControl)AllControl).Base_TextBox; |
|
2771 |
//editTextBox.Style = ((ArrowTextControl)AllControl).Base_TextBox.Style; |
|
2772 |
//editTextBox.Text = (AllControl as ArrowTextControl).ArrowText; |
|
2773 |
//editTextBox.FontSize = (AllControl as ArrowTextControl).FontSize; |
|
2774 |
//editTextBox.Foreground = (AllControl as ArrowTextControl).Foreground; |
|
2775 |
//editTextBox.FontWeight = (AllControl as ArrowTextControl).FontWeight; |
|
2776 |
|
|
2777 |
//(AllControl as ArrowTextControl).Base_TextBox.Visibility = Visibility.Collapsed; |
|
2778 |
//editTextBox = (AllControl as ArrowTextControl).Base_TextBox; |
|
2779 |
//editTextBox.TextChanged += (sen, ea) => |
|
2780 |
// { |
|
2781 |
// ((ArrowTextControl)AllControl).ArrowText = editTextBox.Text; |
|
2782 |
// }; |
|
2783 |
|
|
2784 |
|
|
2785 |
//(sender as System.Windows.Shapes.Rectangle).Visibility = Visibility.Hidden; |
|
2786 |
//((ArrowTextControl)AllControl).Base_TextBox.Background = new SolidColorBrush(Colors.Blue); |
|
2787 |
//((ArrowTextControl)AllControl).Base_TextBox.Opacity = 1; |
|
2788 |
//((ArrowTextControl)AllControl).Base_TextBox.Focus(); |
|
2789 |
|
|
2038 |
|
|
2790 | 2039 |
((ArrowTextControl)AllControl).Base_TextBox.SizeChanged += (sen, ea) => |
2791 | 2040 |
|
2792 | 2041 |
{ |
... | ... | |
2794 | 2043 |
tm.Height = (AllControl as ArrowTextControl).BoxHeight; |
2795 | 2044 |
|
2796 | 2045 |
List<Point> ps = new List<Point>(); |
2797 |
//RotateTransform myRotateTransform = new RotateTransform(); |
|
2798 |
|
|
2799 |
|
|
2800 |
//if (control.Angle == -270) |
|
2801 |
//{ |
|
2802 |
// myRotateTransform.Angle = 90; |
|
2803 |
// myRotateTransform.CenterX = Canvas.GetLeft(control.Base_TextBox); |
|
2804 |
// myRotateTransform.CenterY = Canvas.GetTop(control.Base_TextBox); |
|
2805 |
//} |
|
2806 |
//else if (control.Angle == -90) |
|
2807 |
//{ |
|
2808 |
// myRotateTransform.Angle = 270; |
|
2809 |
// myRotateTransform.CenterX = Canvas.GetLeft(control.Base_TextBox); |
|
2810 |
// myRotateTransform.CenterY = Canvas.GetTop(control.Base_TextBox); |
|
2811 |
//} |
|
2812 |
//TransformGroup myTransformGroup = new TransformGroup(); |
|
2813 |
//myTransformGroup.Children.Add(myRotateTransform); |
|
2814 |
|
|
2046 |
|
|
2815 | 2047 |
ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox) + AllControl.BoxWidth / 2, Canvas.GetTop(AllControl.Base_TextBox))); //상단 |
2816 | 2048 |
ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox) + AllControl.BoxWidth / 2, Canvas.GetTop(AllControl.Base_TextBox) + AllControl.BoxHeight)); // 하단 |
2817 | 2049 |
ps.Add(new Point(Canvas.GetLeft(AllControl.Base_TextBox), Canvas.GetTop(AllControl.Base_TextBox) + AllControl.BoxHeight / 2)); //좌단 |
... | ... | |
2876 | 2108 |
instance.SetArcPath(); |
2877 | 2109 |
BorderUpdate(); |
2878 | 2110 |
} |
2879 |
//else if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "CloudControl") |
|
2880 |
//{ |
|
2881 |
// CloudControl instance = ((MemberSet.First() as AdornerMember).DrawingData as CloudControl); |
|
2882 |
// if (!instance.isChain) |
|
2883 |
// { |
|
2884 |
// if (instance.isTransOn) |
|
2885 |
// { |
|
2886 |
// instance.isTransOn = false; |
|
2887 |
// } |
|
2888 |
// else |
|
2889 |
// { |
|
2890 |
// instance.isTransOn = true; |
|
2891 |
// } |
|
2892 |
|
|
2893 |
// instance.SetCloud(); |
|
2894 |
// BorderUpdate(); |
|
2895 |
// } |
|
2896 |
//} |
|
2897 |
//else if ((MemberSet.First() as AdornerMember).DrawingData.GetType().Name == "LineControl") |
|
2898 |
//{ |
|
2899 |
// LineControl instance = ((MemberSet.First() as AdornerMember).DrawingData as LineControl); |
|
2900 |
// if (instance.LineStyle == LineControl.LineStyleSet.MultiLine) |
|
2901 |
// { |
|
2902 |
// instance.Interval += 1; |
|
2903 |
// instance.SetLinePath(); |
|
2904 |
// BorderUpdate(); |
|
2905 |
// } |
|
2906 |
|
|
2907 |
// //instance.SetCloud(); |
|
2908 |
// //BorderUpdate(); |
|
2909 |
//} |
|
2111 |
|
|
2910 | 2112 |
|
2911 | 2113 |
} |
2912 |
//if (e.ClickCount == 2 && AllControl.GetType().Name == "TextControl") // Edit Mode |
|
2913 |
//{ |
|
2914 |
// ((TextControl)AllControl).Base_TextBox.Focus(); |
|
2915 |
// ((TextControl)AllControl).Base_TextBox.Visibility = Visibility.Visible; |
|
2916 |
// ((TextControl)AllControl).Base_TextBlock.Visibility = Visibility.Collapsed; |
|
2917 |
//} |
|
2918 |
//if (e.ClickCount == 2 && AllControl.GetType().Name == "ArrowTextControl") // Edit Mode |
|
2919 |
//{ |
|
2920 |
// Thumb tm = (from kkk in this.ContainerContent.Children |
|
2921 |
// where (kkk as FrameworkElement).Name == "LastThumb" |
|
2922 |
// select kkk).FirstOrDefault() as Thumb; |
|
2923 |
// ((ArrowTextControl)AllControl).Base_TextBox.Focus(); |
|
2924 |
// ((ArrowTextControl)AllControl).Base_TextBox.SizeChanged += (sen, ea) => |
|
2925 |
// { |
|
2926 |
// tm.Width = (AllControl as ArrowTextControl).BoxWidth; |
|
2927 |
// tm.Height = (AllControl as ArrowTextControl).BoxHeight; |
|
2928 |
// Canvas.SetLeft(tm, (AllControl.EndPoint.X - tm.Width / 2)); |
|
2929 |
// Canvas.SetTop(tm, (AllControl.EndPoint.Y - tm.Height / 2)); |
|
2930 |
// Canvas.SetLeft((AllControl as ArrowTextControl).Base_TextBox, (AllControl.EndPoint.X - tm.Width / 2)); |
|
2931 |
// Canvas.SetTop((AllControl as ArrowTextControl).Base_TextBox, (AllControl.EndPoint.Y - tm.Height / 2)); |
|
2932 |
// }; |
|
2933 |
//} |
|
2114 |
|
|
2934 | 2115 |
} |
2935 | 2116 |
#endregion |
2936 | 2117 |
|
... | ... | |
2942 | 2123 |
} |
2943 | 2124 |
} |
2944 | 2125 |
|
2945 |
//private void testText_Loaded(object sender, RoutedEventArgs e) |
|
2946 |
//{ |
|
2947 |
// editTextBox = sender as TextBox; |
|
2948 |
//} |
|
2949 | 2126 |
} |
2950 | 2127 |
} |
내보내기 Unified diff