개정판 f729ef4e
issue #923: fixed RemoveLineStroke method
Change-Id: I8faab5a46416b6704584f729f2174730db031884
KCOM/Views/MainMenu.xaml.cs | ||
---|---|---|
122 | 122 |
public partial class MainMenu : UserControl |
123 | 123 |
{ |
124 | 124 |
#region 프로퍼티 |
125 |
public Undo_data UndoData { get; set; } |
|
126 | 125 |
public CommentUserInfo currentControl { get; set; } |
127 | 126 |
public ControlType controlType { get; set; } |
128 | 127 |
private Move move = new Move(); |
... | ... | |
3775 | 3774 |
var control = ViewerDataModel.Instance.MarkupControls_USER.Where(data => data.IsMouseOver).FirstOrDefault(); |
3776 | 3775 |
if (control != null) |
3777 | 3776 |
{ |
3778 |
UndoData = new Undo_data() |
|
3779 |
{ |
|
3780 |
IsUndo = false, |
|
3781 |
Event = Event_Type.Delete, |
|
3782 |
EventTime = DateTime.Now, |
|
3783 |
Markup_List = new List<Multi_Undo_data>() |
|
3784 |
}; |
|
3785 |
|
|
3786 |
|
|
3787 |
multi_Undo_Data.Markup = control as MarkupToPDF.Common.CommentUserInfo; |
|
3788 |
UndoData.Markup_List.Add(multi_Undo_Data); |
|
3789 |
multi_Undo_Data = new Multi_Undo_data(); |
|
3790 |
|
|
3791 |
ViewerDataModel.Instance.MarkupControls_USER.Remove(control); |
|
3792 |
var Item_ = ViewerDataModel.Instance.MyMarkupList.Where(d => d.ID == (control as MarkupToPDF.Common.CommentUserInfo).CommentID).FirstOrDefault(); |
|
3793 |
ViewerDataModel.Instance.MyMarkupList.Remove(Item_); |
|
3794 |
|
|
3795 |
//임시파일에서도 삭제한다. |
|
3796 |
TempFile.DelTemp((control as MarkupToPDF.Common.CommentUserInfo).CommentID, this.ParentOfType<MainWindow>().dzMainMenu.pageNavigator.CurrentPage.PageNumber.ToString()); |
|
3797 |
|
|
3798 |
ViewerDataModel.Instance.UndoDataList.Where(data => data.IsUndo == true).ToList().ForEach(i => |
|
3799 |
{ |
|
3800 |
ViewerDataModel.Instance.UndoDataList.Remove(i); |
|
3801 |
}); |
|
3802 |
ViewerDataModel.Instance.UndoDataList.Add(UndoData); |
|
3803 |
|
|
3777 |
DeleteCommand.Instance.Execute(new List<CommentUserInfo>() { control }); |
|
3804 | 3778 |
} |
3805 | 3779 |
} |
3806 | 3780 |
|
... | ... | |
5143 | 5117 |
} |
5144 | 5118 |
|
5145 | 5119 |
/// <summary> |
5146 |
/// 정원, 정사각형, 정삼각형을 그리기 위한 EndPoint계산 |
|
5147 |
/// </summary> |
|
5148 |
/// <param name="StartP">StartPoint</param> |
|
5149 |
/// <param name="EndP">EndPoint</param> |
|
5150 |
/// <returns>Return_EndPoint</returns> |
|
5151 |
private Point GetSquareEndPoint(Point StartP, Point EndP) |
|
5152 |
{ |
|
5153 |
Point Return_Point = new Point(); |
|
5154 |
|
|
5155 |
double dx = EndP.X - StartP.X; |
|
5156 |
double dy = EndP.Y - StartP.Y; |
|
5157 |
double length; |
|
5158 |
|
|
5159 |
switch (controlType) |
|
5160 |
{ |
|
5161 |
case ControlType.Triangle: |
|
5162 |
{ |
|
5163 |
//삼각형의 StartPoint기준으로 반지름 만큼 증가하기 때문에 곱하기2 필요 |
|
5164 |
length = Math.Max(Math.Abs(dx) * 2, Math.Abs(dy)); |
|
5165 |
Return_Point = (dy < 0) ? new Point(StartP.X + length / 2, StartP.Y - length) : new Point(StartP.X + length / 2, StartP.Y + length); |
|
5166 |
} |
|
5167 |
break; |
|
5168 |
default: |
|
5169 |
{ |
|
5170 |
length = Math.Max(Math.Abs(dx), Math.Abs(dy)); |
|
5171 |
Return_Point.X = (dx > 0) ? StartP.X + length : StartP.X - length; |
|
5172 |
Return_Point.Y = (dy > 0) ? StartP.Y + length : StartP.Y - length; |
|
5173 |
} |
|
5174 |
break; |
|
5175 |
} |
|
5176 |
|
|
5177 |
return Return_Point; |
|
5178 |
} |
|
5179 |
|
|
5180 |
/// <summary> |
|
5181 |
/// 정삼각형을 그리기위한 두 포인트를 계산하여 넘겨줌 |
|
5182 |
/// </summary> |
|
5183 |
/// <author>humkyung</author> |
|
5184 |
/// <date>2018.04.26</date> |
|
5185 |
/// <param name="StartP"></param> |
|
5186 |
/// <param name="EndP"></param> |
|
5187 |
/// <returns></returns> |
|
5188 |
/// <history>humkyung 2018.05.11 apply axis lock</history> |
|
5189 |
private List<Point> GetRegularTrianglePoints(Point StartP, Point EndP, bool bCheckAxis = false) |
|
5190 |
{ |
|
5191 |
List<Point> res = new List<Point>(); |
|
5192 |
|
|
5193 |
double dx = EndP.X - StartP.X; |
|
5194 |
double dy = EndP.Y - StartP.Y; |
|
5195 |
double length = Math.Sqrt(dx * dx + dy * dy); |
|
5196 |
double baseLength = length * Math.Tan(30.0 * Math.PI / 180.0); |
|
5197 |
dx /= length; |
|
5198 |
dy /= length; |
|
5199 |
double tmp = dx; |
|
5200 |
dx = -dy; dy = tmp; /// rotate by 90 degree |
|
5201 |
|
|
5202 |
res.Add(new Point(EndP.X + dx * baseLength, EndP.Y + dy * baseLength)); |
|
5203 |
res.Add(new Point(EndP.X - dx * baseLength, EndP.Y - dy * baseLength)); |
|
5204 |
|
|
5205 |
return res; |
|
5206 |
} |
|
5207 |
|
|
5208 |
/// <summary> |
|
5209 | 5120 |
/// 캔버스에 그릴때 모든 포인트가 캔버스를 벗어 났는지 체크하여 넘겨줌 |
5210 | 5121 |
/// </summary> |
5211 | 5122 |
/// <author>ingu</author> |
내보내기 Unified diff