프로젝트

일반

사용자정보

개정판 3dbace4e

ID3dbace4efb86c3804f65465c4229b3224b6d5ef1
상위 39f208de
하위 41c4405e

김태성이(가) 약 4년 전에 추가함

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
                {
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
}
Markus.Fonts/FontHelper.cs
62 62
                throw new Exception("FontName Error" + ex.ToString());
63 63
            }
64 64

  
65
            System.Diagnostics.Debug.WriteLine($"Font Name {result}");
65
            //System.Diagnostics.Debug.WriteLine($"Font Name {result}");
66 66

  
67 67
            return result;
68 68
        }

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)