프로젝트

일반

사용자정보

개정판 e5bd2147

IDe5bd2147bc2e96d20d8d6594b40d487eba53b0cd
상위 301568ad
하위 cc37956c

임예철이(가) 9달 전에 추가함

Undo push method 수정
font size 수정

Change-Id: Ib02186683c56b454c0a50bdb8dddb8165111d5e3

차이점 보기:

KCOM/Controls/AdornerFinal.xaml.cs
1227 1227

  
1228 1228
            var comments = (from drawing in this.Members
1229 1229
                            select drawing.DrawingData as CommentUserInfo).ToList();
1230
            UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstPointTemp);
1230
            //UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstPointTemp);
1231 1231
            ViewerDataModel.Instance.IsMarkupUpdate = true;
1232 1232
        }
1233 1233

  
......
1246 1246
                return;
1247 1247
            }
1248 1248

  
1249
            if (lstBeforePointSet == null)
1250
                lstBeforePointSet = new List<Point>();
1251

  
1252
            lstBeforePointSet.Clear();
1253
            foreach(var vPoint in ((dynamic)this.Members.FirstOrDefault().DrawingData).PointSet)
1254
            {
1255
                lstBeforePointSet.Add(vPoint);
1256
            }
1257

  
1258
            //lstBeforePointSet = ((dynamic)this.Members.FirstOrDefault().DrawingData).PointSet;
1259

  
1260
            if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb))
1261
            {
1262
                return;
1263
            }
1249
            
1250
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb))
1251
            //{
1252
            //    return;
1253
            //}
1264 1254

  
1265
            if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List != null))
1266
            {
1267
                if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.Count > 0)
1268
                {
1269
                    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.FirstOrDefault().PointSet != null)
1270
                    {
1271
                        return;
1272
                    }
1273
                }
1274
            }
1255
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List != null))
1256
            //{
1257
            //    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.Count > 0)
1258
            //    {
1259
            //        if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.FirstOrDefault().PointSet != null)
1260
            //        {
1261
            //            return;
1262
            //        }
1263
            //    }
1264
            //}
1275 1265

  
1276 1266
            var comments = (from drawing in this.Members
1277 1267
                            select drawing.DrawingData as CommentUserInfo).ToList();
1278
            UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstBeforePointSet);
1268
            //UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstBeforePointSet);
1269
            UndoCommand.Instance.Push(comments);
1279 1270
        }
1280 1271

  
1281 1272
        private void rotate_MouseMove(object sender, MouseEventArgs e)
......
1313 1304
            {
1314 1305
                return;
1315 1306
            }
1316
            if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb))
1317
            {
1318
                return;
1319
            }
1320
            if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List != null))
1321
            {
1322
                if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.Count > 0)
1323
                {
1324
                    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.FirstOrDefault().PointSet != null)
1325
                    {
1326
                        return;
1327
                    }
1328
                }
1329
            }
1307
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb))
1308
            //{
1309
            //    return;
1310
            //}
1311
            //if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List != null))
1312
            //{
1313
            //    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.Count > 0)
1314
            //    {
1315
            //        if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.FirstOrDefault().PointSet != null)
1316
            //        {
1317
            //            return;
1318
            //        }
1319
            //    }
1320
            //}
1330 1321

  
1331 1322
            var comments = (from drawing in this.Members
1332 1323
                            select drawing.DrawingData as CommentUserInfo).ToList();
1333
            UndoCommand.Instance.Push(comments, this.AngleValue);
1324
            //UndoCommand.Instance.Push(comments, this.AngleValue);
1325
            UndoCommand.Instance.Push(comments);
1334 1326
        }
1335 1327

  
1336 1328
        private void drag_DragCompleted(object sender, DragCompletedEventArgs e)
......
1339 1331

  
1340 1332
            var comments = (from drawing in this.Members
1341 1333
                            select drawing.DrawingData as CommentUserInfo).ToList();
1342
            UndoCommand.Instance.Push(comments, this.AngleValue);
1334
            //UndoCommand.Instance.Push(comments, this.AngleValue);
1343 1335
        }
1344 1336

  
1345 1337
        private void DragThumb_DragDelta(object sender, DragDeltaEventArgs e)
......
1569 1561
            }
1570 1562
            /// up to here
1571 1563

  
1572
            dBeforeAngle = this.angleValue;
1564
            //dBeforeAngle = this.angleValue;
1573 1565

  
1574 1566
            if (ViewerDataModel.Instance.UndoDataList == null)
1575 1567
            {
1576 1568
                return;
1577 1569
            }
1578 1570

  
1579
            if ((ViewerDataModel.Instance.UndoDataList.Count > 0) && ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb)
1580
            {
1581
                return;
1582
            }
1571
            //if ((ViewerDataModel.Instance.UndoDataList.Count > 0) && ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb)
1572
            //{
1573
            //    return;
1574
            //}
1583 1575

  
1584
            if ((ViewerDataModel.Instance.UndoDataList.Count > 0) && ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List != null)
1585
            {
1586
                if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.Count > 0)
1587
                {
1588
                    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.FirstOrDefault().PointSet != null)
1589
                    {
1590
                        return;
1591
                    }
1592
                }
1593
            }
1576
            //if ((ViewerDataModel.Instance.UndoDataList.Count > 0) && ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List != null)
1577
            //{
1578
            //    if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.Count > 0)
1579
            //    {
1580
            //        if (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Markup_List.FirstOrDefault().PointSet != null)
1581
            //        {
1582
            //            return;
1583
            //        }
1584
            //    }
1585
            //}
1594 1586

  
1595 1587
            var comments = (from drawing in this.Members
1596 1588
                            select drawing.DrawingData as CommentUserInfo).ToList();
1597
            UndoCommand.Instance.Push(comments, this.AngleValue, this.angleValue);
1589
            //UndoCommand.Instance.Push(comments, this.AngleValue, this.angleValue);
1590
            UndoCommand.Instance.Push(comments);
1598 1591
        }
1599 1592
        
1600 1593
        private void rotate_DragCompleted(object sender, DragCompletedEventArgs e)
......
1605 1598

  
1606 1599
            var comments = (from drawing in this.Members
1607 1600
                            select drawing.DrawingData as CommentUserInfo).ToList();
1608
            UndoCommand.Instance.Push(comments, this.AngleValue, dBeforeAngle);
1601
            //UndoCommand.Instance.Push(comments, this.AngleValue, dBeforeAngle);
1609 1602
        }
1610 1603

  
1611 1604
        public void ControlPointMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
KCOM/Events/Implementation/TopMenuEvent.cs
97 97

  
98 98
            if (adornerMembers.Count() > 0)
99 99
            {
100
                UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList(), adnoerFinal.AngleValue);
100
                //UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList(), adnoerFinal.AngleValue);
101
                UndoCommand.Instance.Push(adornerMembers.Select(x => x.DrawingData).Cast<CommentUserInfo>().ToList());
101 102
            }
102 103
        }
103 104

  
KCOM/Events/UndoCommand.cs
47 47
        /// <author>humkyung</author>
48 48
        /// <date>2019.06.14</date>
49 49
        /// <param name="comments"></param>
50
        public void Push(ICollection<CommentUserInfo> comments, double dAngle, double dBeforeAngle = 0.0, List<Point> lstBeforePointSet = null)
50
        //public void Push(ICollection<CommentUserInfo> comments, double dAngle, double dBeforeAngle = 0.0, List<Point> lstBeforePointSet = null)
51
        //{
52
        //    Undo_data UndoData = new Undo_data()
53
        //    {
54
        //        IsUndo = false,
55
        //        Event = Event_Type.Thumb,
56
        //        EventTime = DateTime.Now,
57
        //        Markup_List = new List<Multi_Undo_data>(),
58
        //    };
59

  
60
        //    Multi_Undo_data multi_Undo_Data = new Multi_Undo_data();
61

  
62
        //    foreach (var comment in comments)
63
        //    {
64
        //        multi_Undo_Data.PointSet = new List<Point>();
65
        //        var p_set = new List<Point>();
66

  
67
        //        if (comment is TextControl)
68
        //        {
69
        //            multi_Undo_Data.PointSet.Add((comment as TextControl).StartPoint);
70
        //            multi_Undo_Data.PointSet.Add((comment as TextControl).EndPoint);
71
        //        }
72

  
73
        //        foreach (var point in (comment as IPath).PointSet)
74
        //        {
75
        //            multi_Undo_Data.PointSet.Add(point);
76
        //        }
77

  
78
        //        if (lstBeforePointSet != null)
79
        //            multi_Undo_Data.BeforePointSet = lstBeforePointSet;
80

  
81
        //        if (comment is ArrowTextControl)
82
        //        {
83
        //            //multi_Undo_Data.Angle = dAngle = (comment as ArrowTextControl).CommentAngle;
84
        //            multi_Undo_Data.Angle = dAngle;
85
        //            multi_Undo_Data.BeforeAngle = dBeforeAngle;
86
        //        }
87
        //        else
88
        //        {
89
        //            multi_Undo_Data.Angle = dAngle;
90
        //            multi_Undo_Data.BeforeAngle = dBeforeAngle;
91
        //        }
92

  
93
        //        multi_Undo_Data.Markup = comment;
94
        //        UndoData.Markup_List.Add(multi_Undo_Data);
95
        //        ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
96
        //                    MarkupParser.MarkupToString(multi_Undo_Data.Markup, App.ViewInfo.UserID), Event_Type.Thumb, null, null);
97

  
98
        //        multi_Undo_Data = new Multi_Undo_data();                
99
        //    }
100
        //    ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
101
        //    {
102
        //        ViewerDataModel.Instance.UndoDataList.Remove(i);
103
        //    });
104

  
105
        //    ViewerDataModel.Instance.UndoDataList.Add(UndoData);            
106
        //}
107

  
108
        public void Push(ICollection<CommentUserInfo> comments)
51 109
        {
52 110
            Undo_data UndoData = new Undo_data()
53 111
            {
......
75 133
                    multi_Undo_Data.PointSet.Add(point);
76 134
                }
77 135

  
78
                if (lstBeforePointSet != null)
79
                    multi_Undo_Data.BeforePointSet = lstBeforePointSet;
136

  
137
                List<Point> points = new List<Point>();
138
                foreach(var point in (comment as IPath).PointSet)
139
                {
140
                    points.Add(point);
141
                }
142
                multi_Undo_Data.BeforePointSet = points;
80 143

  
81 144
                if (comment is ArrowTextControl)
82 145
                {
83 146
                    //multi_Undo_Data.Angle = dAngle = (comment as ArrowTextControl).CommentAngle;
84
                    multi_Undo_Data.Angle = dAngle;
85
                    multi_Undo_Data.BeforeAngle = dBeforeAngle;
147
                    multi_Undo_Data.Angle = comment.CommentAngle;
86 148
                }
87 149
                else
88 150
                {
89
                    multi_Undo_Data.Angle = dAngle;
90
                    multi_Undo_Data.BeforeAngle = dBeforeAngle;
151
                    multi_Undo_Data.Angle = comment.CommentAngle;
91 152
                }
92 153

  
93 154
                multi_Undo_Data.Markup = comment;
......
95 156
                ViewerDataModel.Instance.SystemMain.dzMainMenu.pageNavigator.MarkupListUpdate(
96 157
                            MarkupParser.MarkupToString(multi_Undo_Data.Markup, App.ViewInfo.UserID), Event_Type.Thumb, null, null);
97 158

  
98
                multi_Undo_Data = new Multi_Undo_data();                
159
                multi_Undo_Data = new Multi_Undo_data();
99 160
            }
100 161
            ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i =>
101 162
            {
102 163
                ViewerDataModel.Instance.UndoDataList.Remove(i);
103 164
            });
104 165

  
105
            ViewerDataModel.Instance.UndoDataList.Add(UndoData);            
166
            ViewerDataModel.Instance.UndoDataList.Add(UndoData);
106 167
        }
107 168

  
108 169
        /// <summary>
MarkupToPDF/Controls/Text/TextControl.cs
87 87
            Base_Border = GetTemplateChild(PART_Border) as Border;
88 88
            Base_Canvas = GetTemplateChild(PART_Canvas) as Canvas;
89 89
            BaseTextbox_Caret = GetTemplateChild(PART_BaseTextbox_Caret) as Border;
90
            BaseTextbox_Caret.Height = this.Base_TextBox.FontSize;
90
            //BaseTextbox_Caret.Height = this.Base_TextBox.FontSize;
91 91
            this.Base_TextBox.Text = this.Text;
92 92
            this.Base_TextBox.CaretIndex = this.Base_TextBox.Text.Length;
93 93
            this.Base_TextBox.CaretBrush = new SolidColorBrush(Colors.Transparent);
94 94
            this.Base_TextBox.ApplyTemplate();
95 95
            MoveCustomCaret();
96
            if(this.Base_TextBox.FontSize > this.BaseTextbox_Caret.Height)
97
            {
98
                BaseTextbox_Caret.Height = this.Base_TextBox.FontSize;
99
            }
100
            //BaseTextbox_Caret.Height = Base_TextBox.ActualHeight - 5;
96 101

  
97 102
            this.Base_TextBox.SizeChanged += new SizeChangedEventHandler(Base_TextBox_SizeChanged);
98 103
            this.Base_TextBox.TextChanged += new TextChangedEventHandler(Base_TextBox_TextChanged);
......
134 139
            }
135 140

  
136 141
            if (!double.IsInfinity(caretLocation.Y)) {
137
                Canvas.SetTop(this.BaseTextbox_Caret, (LineSize.Top + caretLocation.Y));
142
                Canvas.SetTop(this.BaseTextbox_Caret, caretLocation.Y);
143
                //Canvas.SetTop(this.BaseTextbox_Caret, (LineSize.Top - caretLocation.Y));
138 144
            }
139 145
        }
140 146

  

내보내기 Unified diff

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