개정판 fd452a01
Undo 수정
Change-Id: Ic43e4c2eb2d06d8e27e8154f09ffe4728ce3c96c
KCOM/Common/SelectionSet.cs | ||
---|---|---|
148 | 148 |
|
149 | 149 |
var control = InnerItem.DrawingData as CommentUserInfo; |
150 | 150 |
ViewerDataModel.Instance.MarkupControls_USER.Add(control); |
151 |
|
|
152 |
MarkupToPDF.Common.Undo_data UndoData = new Undo_data() |
|
151 |
|
|
152 |
var vUndoBeforeTargetItem = |
|
153 |
ViewerDataModel.Instance.UndoDataList.ToList().FindAll(x => x.Markup_List.FindAll |
|
154 |
(y => (y.Markup == control && y.Angle != y.BeforeAngle) || y.Markup == control && y.PointSet != y.BeforePointSet).Count > 0) |
|
155 |
.OrderByDescending(order => order.EventTime).FirstOrDefault(); |
|
156 |
|
|
157 |
if (vUndoBeforeTargetItem != null) |
|
153 | 158 |
{ |
154 |
IsUndo = false, |
|
155 |
Event = Event_Type.Create, |
|
156 |
EventTime = DateTime.Now, |
|
157 |
Markup_List = new List<Multi_Undo_data>() |
|
158 |
}; |
|
159 |
|
|
160 |
var multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(control); |
|
161 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
162 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
159 |
|
|
160 |
} |
|
161 |
else |
|
162 |
{ |
|
163 |
MarkupToPDF.Common.Undo_data UndoData = new Undo_data() |
|
164 |
{ |
|
165 |
IsUndo = false, |
|
166 |
Event = Event_Type.Create, |
|
167 |
EventTime = DateTime.Now, |
|
168 |
Markup_List = new List<Multi_Undo_data>() |
|
169 |
}; |
|
170 |
|
|
171 |
var multi_Undo_Data = Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.Control_Style(control); |
|
172 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
173 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
174 |
} |
|
163 | 175 |
Common.ViewerDataModel.Instance.SystemMain.dzMainMenu.UpdateMyMarkupList(); |
164 | 176 |
} |
165 | 177 |
} |
KCOM/Controls/AdornerFinal.xaml.cs | ||
---|---|---|
159 | 159 |
private List<double> AlignedAngles {get;} = new List<double>() { 0, 30, 45, 60, 90, 120, 135, 150, 180, 210, 225, 240, 270, 300, 315, 330, 360 }; |
160 | 160 |
|
161 | 161 |
private double angleValue; |
162 |
public double dBeforeAngle { get; set; } |
|
162 | 163 |
|
163 | 164 |
public double AngleValue { get => angleValue; |
164 | 165 |
set |
... | ... | |
170 | 171 |
} |
171 | 172 |
} |
172 | 173 |
|
174 |
public List<Point> lstBeforePointSet { get; set; } |
|
175 |
|
|
173 | 176 |
public bool IsTextAngle = false; |
174 | 177 |
public Rect BorderSize { get; set; } |
175 | 178 |
public bool TextCompensation = false; |
... | ... | |
1216 | 1219 |
this.isDragging = false; |
1217 | 1220 |
DraggerThumb = null; |
1218 | 1221 |
|
1222 |
List<Point> lstPointTemp = new List<Point>(); |
|
1223 |
foreach(var vPoint in this.lstBeforePointSet) |
|
1224 |
{ |
|
1225 |
lstPointTemp.Add(vPoint); |
|
1226 |
} |
|
1227 |
|
|
1219 | 1228 |
var comments = (from drawing in this.Members |
1220 | 1229 |
select drawing.DrawingData as CommentUserInfo).ToList(); |
1221 |
UndoCommand.Instance.Push(comments, this.AngleValue); |
|
1230 |
UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstPointTemp);
|
|
1222 | 1231 |
ViewerDataModel.Instance.IsMarkupUpdate = true; |
1223 | 1232 |
} |
1224 | 1233 |
|
... | ... | |
1237 | 1246 |
return; |
1238 | 1247 |
} |
1239 | 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 |
|
|
1240 | 1260 |
if ((null != ViewerDataModel.Instance.UndoDataList.LastOrDefault()) && (ViewerDataModel.Instance.UndoDataList.LastOrDefault().Event == Event_Type.Thumb)) |
1241 | 1261 |
{ |
1242 | 1262 |
return; |
... | ... | |
1255 | 1275 |
|
1256 | 1276 |
var comments = (from drawing in this.Members |
1257 | 1277 |
select drawing.DrawingData as CommentUserInfo).ToList(); |
1258 |
UndoCommand.Instance.Push(comments, this.AngleValue); |
|
1278 |
UndoCommand.Instance.Push(comments, this.AngleValue, 0, lstBeforePointSet);
|
|
1259 | 1279 |
} |
1260 | 1280 |
|
1261 | 1281 |
private void rotate_MouseMove(object sender, MouseEventArgs e) |
... | ... | |
1549 | 1569 |
} |
1550 | 1570 |
/// up to here |
1551 | 1571 |
|
1572 |
dBeforeAngle = this.angleValue; |
|
1573 |
|
|
1552 | 1574 |
if (ViewerDataModel.Instance.UndoDataList == null) |
1553 | 1575 |
{ |
1554 | 1576 |
return; |
... | ... | |
1572 | 1594 |
|
1573 | 1595 |
var comments = (from drawing in this.Members |
1574 | 1596 |
select drawing.DrawingData as CommentUserInfo).ToList(); |
1575 |
UndoCommand.Instance.Push(comments, this.AngleValue); |
|
1597 |
UndoCommand.Instance.Push(comments, this.AngleValue, this.angleValue);
|
|
1576 | 1598 |
} |
1577 | 1599 |
|
1578 | 1600 |
private void rotate_DragCompleted(object sender, DragCompletedEventArgs e) |
1579 | 1601 |
{ |
1580 | 1602 |
rotateTop.Cursor = new Cursor(App.DefaultArrowCursorStream); |
1581 | 1603 |
|
1604 |
|
|
1605 |
|
|
1582 | 1606 |
var comments = (from drawing in this.Members |
1583 | 1607 |
select drawing.DrawingData as CommentUserInfo).ToList(); |
1584 |
UndoCommand.Instance.Push(comments, this.AngleValue); |
|
1608 |
UndoCommand.Instance.Push(comments, this.AngleValue, dBeforeAngle);
|
|
1585 | 1609 |
} |
1586 | 1610 |
|
1587 | 1611 |
public void ControlPointMouseLeftButtonDown(object sender, MouseButtonEventArgs e) |
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) |
|
50 |
public void Push(ICollection<CommentUserInfo> comments, double dAngle, double dBeforeAngle = 0.0, List<Point> lstBeforePointSet = null)
|
|
51 | 51 |
{ |
52 | 52 |
Undo_data UndoData = new Undo_data() |
53 | 53 |
{ |
... | ... | |
75 | 75 |
multi_Undo_Data.PointSet.Add(point); |
76 | 76 |
} |
77 | 77 |
|
78 |
if (lstBeforePointSet != null) |
|
79 |
multi_Undo_Data.BeforePointSet = lstBeforePointSet; |
|
80 |
|
|
78 | 81 |
if (comment is ArrowTextControl) |
79 | 82 |
{ |
80 |
multi_Undo_Data.Angle = dAngle = (comment as ArrowTextControl).CommentAngle; |
|
83 |
//multi_Undo_Data.Angle = dAngle = (comment as ArrowTextControl).CommentAngle; |
|
84 |
multi_Undo_Data.Angle = dAngle; |
|
85 |
multi_Undo_Data.BeforeAngle = dBeforeAngle; |
|
81 | 86 |
} |
82 | 87 |
else |
83 | 88 |
{ |
84 | 89 |
multi_Undo_Data.Angle = dAngle; |
90 |
multi_Undo_Data.BeforeAngle = dBeforeAngle; |
|
85 | 91 |
} |
86 | 92 |
|
87 | 93 |
multi_Undo_Data.Markup = comment; |
... | ... | |
169 | 175 |
} |
170 | 176 |
if ((item.Markup as TextControl) != null) |
171 | 177 |
{ |
172 |
(item.Markup as TextControl).CommentAngle = item.Angle; |
|
178 |
//(item.Markup as TextControl).CommentAngle = item.Angle; |
|
179 |
(item.Markup as TextControl).CommentAngle = item.BeforeAngle; |
|
173 | 180 |
Canvas.SetLeft((item.Markup as TextControl), item.PointSet[0].X); |
174 | 181 |
Canvas.SetTop((item.Markup as TextControl), item.PointSet[0].Y); |
175 | 182 |
} |
176 | 183 |
else |
177 | 184 |
{ |
178 |
(item.Markup as IPath).PointSet = item.PointSet; |
|
185 |
(item.Markup).CommentAngle = item.BeforeAngle; |
|
186 |
//(item.Markup as IPath).PointSet = item.PointSet; |
|
187 |
(item.Markup as IPath).PointSet = item.BeforePointSet != null ? item.BeforePointSet : new List<Point>(); |
|
179 | 188 |
(item.Markup as CommentUserInfo).UpdateControl(); |
180 | 189 |
} |
181 | 190 |
|
MarkupToPDF/Common/Undo_data.cs | ||
---|---|---|
40 | 40 |
public Double Opacity { get; set; } |
41 | 41 |
public Controls.Common.PaintSet paint { get; set; } |
42 | 42 |
public double Angle { get; set; } |
43 |
public double BeforeAngle { get; set; } |
|
44 |
public List<Point> BeforePointSet { get; set; } |
|
43 | 45 |
} |
44 | 46 |
|
45 | 47 |
public enum Event_Type |
MarkupToPDF/Controls/Polygon/CloudControl.cs | ||
---|---|---|
1019 | 1019 |
{ |
1020 | 1020 |
this.IsCompleted = true; |
1021 | 1021 |
|
1022 |
|
|
1023 | 1022 |
//var firstPoint = this.PointSet.First(); |
1024 | 1023 |
//this.PointSet.Add(firstPoint); |
1025 | 1024 |
|
MarkupToPDF/Controls/Polygon/PolygonControl.cs | ||
---|---|---|
506 | 506 |
{ |
507 | 507 |
this.IsCompleted = true; |
508 | 508 |
|
509 |
|
|
510 | 509 |
//var firstPoint = this.PointSet.First(); |
511 | 510 |
//this.PointSet.Add(firstPoint); |
512 | 511 |
|
내보내기 Unified diff