개정판 284ed1c7
Fix: 심볼을 배치할때 심볼이 밑으로 배치되는 오류 수정
- ArrowTextControl에서 시작점, 중간점 이동 오류 수정
Change-Id: Iafa96ec0854b5a5716729e103308b87e4cfd5013
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
1012 | 1012 |
this.BaseTextbox_Caret.Visibility = Visibility.Collapsed; |
1013 | 1013 |
} |
1014 | 1014 |
|
1015 |
private void SetArrowTextPath(bool IsInit = false) |
|
1015 |
/// <summary> |
|
1016 |
/// 연결점 리스트를 리턴한다. |
|
1017 |
/// </summary> |
|
1018 |
/// <returns></returns> |
|
1019 |
private List<Point> GetConnectionPointList() |
|
1016 | 1020 |
{ |
1017 |
instanceGroup.Children.Clear(); |
|
1018 |
|
|
1019 |
if (Math.Abs(PageAngle).ToString() == "90") |
|
1020 |
{ |
|
1021 |
VisualPageAngle = 270; |
|
1022 |
} |
|
1023 |
else if (Math.Abs(PageAngle).ToString() == "270") |
|
1024 |
{ |
|
1025 |
VisualPageAngle = 90; |
|
1026 |
} |
|
1027 |
else |
|
1028 |
{ |
|
1029 |
VisualPageAngle = PageAngle; |
|
1030 |
} |
|
1031 |
|
|
1032 |
connectorSMGeometry.StartPoint = this.StartPoint; |
|
1033 |
connectorSMGeometry.EndPoint = this.MidPoint; |
|
1034 |
connectorMEGeometry.StartPoint = this.MidPoint; //핵심 |
|
1035 |
|
|
1036 |
/// 텍스트박스의 좌표 설정 |
|
1037 |
Canvas.SetLeft(Base_TextBox, this.EndPoint.X); |
|
1038 |
Canvas.SetTop(Base_TextBox, this.EndPoint.Y); |
|
1039 |
|
|
1040 |
List<Point> ps = new List<Point>(); |
|
1041 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth / 2, Canvas.GetTop(Base_TextBox))); //상단 |
|
1042 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth / 2, Canvas.GetTop(Base_TextBox) + this.BoxHeight)); // 하단 |
|
1043 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxHeight / 2)); //좌단 |
|
1044 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox) + this.BoxHeight / 2)); //우단 |
|
1021 |
List<Point> res = new List<Point>(); |
|
1022 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth / 2, Canvas.GetTop(Base_TextBox))); //상단 |
|
1023 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth / 2, Canvas.GetTop(Base_TextBox) + this.BoxHeight)); // 하단 |
|
1024 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxHeight / 2)); //좌단 |
|
1025 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxWidth, Canvas.GetTop(Base_TextBox) + this.BoxHeight / 2)); //우단 |
|
1045 | 1026 |
|
1046 | 1027 |
if (isTrans) |
1047 | 1028 |
{ |
... | ... | |
1049 | 1030 |
{ |
1050 | 1031 |
case "90": |
1051 | 1032 |
{ |
1052 |
ps.Clear(); |
|
1053 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1054 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); // 위 중간 |
|
1055 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth)); // 위 오른쪽 |
|
1033 |
res.Clear(); |
|
1034 |
|
|
1035 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1036 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); // 위 중간 |
|
1037 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth)); // 위 오른쪽 |
|
1056 | 1038 |
|
1057 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간
|
|
1058 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단
|
|
1039 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간
|
|
1040 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단
|
|
1059 | 1041 |
|
1060 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); //중간 하단
|
|
1061 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 하단
|
|
1042 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); //중간 하단
|
|
1043 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 하단
|
|
1062 | 1044 |
|
1063 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 중간
|
|
1045 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 중간
|
|
1064 | 1046 |
} |
1065 | 1047 |
break; |
1066 | 1048 |
case "270": |
1067 | 1049 |
{ |
1068 |
ps.Clear(); |
|
1069 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1070 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
|
1071 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth)); // 위 오른쪽 |
|
1050 |
res.Clear(); |
|
1072 | 1051 |
|
1073 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간 |
|
1074 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단 |
|
1052 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1053 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
|
1054 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth)); // 위 오른쪽 |
|
1075 | 1055 |
|
1076 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); //중간 하단
|
|
1077 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 하단
|
|
1056 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간
|
|
1057 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단
|
|
1078 | 1058 |
|
1079 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간 |
|
1059 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); //중간 하단 |
|
1060 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 하단 |
|
1061 |
|
|
1062 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간 |
|
1080 | 1063 |
} |
1081 | 1064 |
break; |
1082 | 1065 |
default: |
1083 | 1066 |
break; |
1084 | 1067 |
} |
1085 |
|
|
1086 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.MidPoint); |
|
1087 |
|
|
1088 |
//20180911 LJY 꺾이는 부분 수정 |
|
1089 |
Point BendingPoint = ConnectionPoint; |
|
1068 |
} |
|
1069 |
else |
|
1070 |
{ |
|
1090 | 1071 |
switch (Math.Abs(this.PageAngle).ToString()) |
1091 | 1072 |
{ |
1092 | 1073 |
case "90": |
1093 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y); |
|
1074 |
{ |
|
1075 |
res.Clear(); |
|
1076 |
|
|
1077 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1078 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); // 위 중간 |
|
1079 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth)); // 위 오른쪽 |
|
1080 |
|
|
1081 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간 |
|
1082 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단 |
|
1083 |
|
|
1084 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); //중간 하단 |
|
1085 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 하단 |
|
1086 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 중간 |
|
1087 |
} |
|
1094 | 1088 |
break; |
1095 | 1089 |
case "270": |
1096 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y); |
|
1090 |
{ |
|
1091 |
res.Clear(); |
|
1092 |
|
|
1093 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1094 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
|
1095 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth)); // 위 오른쪽 |
|
1096 |
|
|
1097 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간 |
|
1098 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단 |
|
1099 |
|
|
1100 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); //중간 하단 |
|
1101 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 하단 |
|
1102 |
|
|
1103 |
res.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간 |
|
1104 |
} |
|
1105 |
break; |
|
1106 |
default: |
|
1097 | 1107 |
break; |
1098 |
} |
|
1108 |
} |
|
1109 |
} |
|
1110 |
|
|
1111 |
return res; |
|
1112 |
} |
|
1099 | 1113 |
|
1114 |
/// <summary> |
|
1115 |
/// connection을 이용하여 꺽인점의 위치를 구한다. |
|
1116 |
/// </summary> |
|
1117 |
/// <returns></returns> |
|
1118 |
private Point? GetBendingPoint(List<Point> ConnectionPointList, Point connection) |
|
1119 |
{ |
|
1120 |
Point? BendingPoint = null; |
|
1121 |
|
|
1122 |
if (isTrans) |
|
1123 |
{ |
|
1100 | 1124 |
//20180910 LJY 각도에 따라. |
1101 | 1125 |
switch (Math.Abs(this.PageAngle).ToString()) |
1102 | 1126 |
{ |
1103 | 1127 |
case "90": |
1104 | 1128 |
if (isFixed) |
1105 | 1129 |
{ |
1106 |
if (ps[0] == ConnectionPoint) //상단
|
|
1130 |
if (ConnectionPointList[0] == connection) //상단
|
|
1107 | 1131 |
{ |
1108 |
BendingPoint = new Point(ConnectionPoint.X , ConnectionPoint.Y + _BendingLineLength);
|
|
1132 |
BendingPoint = new Point(connection.X, connection.Y + _BendingLineLength);
|
|
1109 | 1133 |
} |
1110 |
else if (ps[1] == ConnectionPoint) //하단
|
|
1134 |
else if (ConnectionPointList[1] == connection) //하단
|
|
1111 | 1135 |
{ |
1112 |
BendingPoint = new Point(ConnectionPoint.X , ConnectionPoint.Y - _BendingLineLength);
|
|
1136 |
BendingPoint = new Point(connection.X, connection.Y - _BendingLineLength);
|
|
1113 | 1137 |
} |
1114 |
else if (ps[2] == ConnectionPoint) //좌단
|
|
1138 |
else if (ConnectionPointList[2] == connection) //좌단
|
|
1115 | 1139 |
{ |
1116 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1140 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1117 | 1141 |
} |
1118 |
else if (ps[3] == ConnectionPoint) //우단
|
|
1142 |
else if (ConnectionPointList[3] == connection) //우단
|
|
1119 | 1143 |
{ |
1120 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1144 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1121 | 1145 |
} |
1122 | 1146 |
} |
1123 | 1147 |
break; |
1124 | 1148 |
case "270": |
1125 | 1149 |
if (isFixed) |
1126 | 1150 |
{ |
1127 |
if (ps[0] == ConnectionPoint) //상단
|
|
1151 |
if (ConnectionPointList[0] == connection) //상단
|
|
1128 | 1152 |
{ |
1129 |
BendingPoint = new Point(ConnectionPoint.X , ConnectionPoint.Y - _BendingLineLength);
|
|
1153 |
BendingPoint = new Point(connection.X, connection.Y - _BendingLineLength);
|
|
1130 | 1154 |
} |
1131 |
else if (ps[1] == ConnectionPoint) //하단
|
|
1155 |
else if (ConnectionPointList[1] == connection) //하단
|
|
1132 | 1156 |
{ |
1133 |
BendingPoint = new Point(ConnectionPoint.X, ConnectionPoint.Y + _BendingLineLength);
|
|
1157 |
BendingPoint = new Point(connection.X, connection.Y + _BendingLineLength);
|
|
1134 | 1158 |
} |
1135 |
else if (ps[2] == ConnectionPoint) //좌단
|
|
1159 |
else if (ConnectionPointList[2] == connection) //좌단
|
|
1136 | 1160 |
{ |
1137 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1161 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1138 | 1162 |
} |
1139 |
else if (ps[3] == ConnectionPoint) //우단
|
|
1163 |
else if (ConnectionPointList[3] == connection) //우단
|
|
1140 | 1164 |
{ |
1141 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1165 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1142 | 1166 |
} |
1143 | 1167 |
} |
1144 | 1168 |
break; |
1145 | 1169 |
default: |
1146 | 1170 |
if (isFixed) |
1147 | 1171 |
{ |
1148 |
if (ps[0] == ConnectionPoint) //상단
|
|
1172 |
if (ConnectionPointList[0] == connection) //상단
|
|
1149 | 1173 |
{ |
1150 |
BendingPoint = new Point(ConnectionPoint.X, ConnectionPoint.Y - _BendingLineLength);
|
|
1174 |
BendingPoint = new Point(connection.X, connection.Y - _BendingLineLength);
|
|
1151 | 1175 |
} |
1152 |
else if (ps[1] == ConnectionPoint) //하단
|
|
1176 |
else if (ConnectionPointList[1] == connection) //하단
|
|
1153 | 1177 |
{ |
1154 |
BendingPoint = new Point(ConnectionPoint.X, ConnectionPoint.Y + _BendingLineLength);
|
|
1178 |
BendingPoint = new Point(connection.X, connection.Y + _BendingLineLength);
|
|
1155 | 1179 |
} |
1156 |
else if (ps[2] == ConnectionPoint) //좌단
|
|
1180 |
else if (ConnectionPointList[2] == connection) //좌단
|
|
1157 | 1181 |
{ |
1158 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1182 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1159 | 1183 |
} |
1160 |
else if (ps[3] == ConnectionPoint) //우단
|
|
1184 |
else if (ConnectionPointList[3] == connection) //우단
|
|
1161 | 1185 |
{ |
1162 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1186 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1163 | 1187 |
} |
1164 | 1188 |
} |
1165 | 1189 |
break; |
1166 | 1190 |
} |
1167 |
|
|
1168 |
connectorSMGeometry.EndPoint = BendingPoint; |
|
1169 |
connectorMEGeometry.StartPoint = BendingPoint; |
|
1170 |
connectorMEGeometry.EndPoint = ConnectionPoint; |
|
1171 |
|
|
1172 |
//20180910 LJY 각도에 따라. |
|
1173 |
this.MidPoint = BendingPoint; |
|
1174 |
instanceGroup.Children.Add(DrawSet.DrawArrow(BendingPoint, this.StartPoint, this.LineSize)); |
|
1175 |
instanceGroup.FillRule = FillRule.Nonzero; |
|
1176 |
this.Base_ArrowPath.Fill = this.StrokeColor; |
|
1177 |
this.Base_ArrowSubPath.Fill = this.StrokeColor; |
|
1178 | 1191 |
} |
1179 | 1192 |
else |
1180 | 1193 |
{ |
1181 |
switch (Math.Abs(this.PageAngle).ToString()) |
|
1182 |
{ |
|
1183 |
case "90": |
|
1184 |
{ |
|
1185 |
ps.Clear(); |
|
1186 |
|
|
1187 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1188 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); // 위 중간 |
|
1189 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) - this.BoxWidth)); // 위 오른쪽 |
|
1190 |
|
|
1191 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간 |
|
1192 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단 |
|
1193 |
|
|
1194 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth / 2)); //중간 하단 |
|
1195 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 하단 |
|
1196 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) - this.BoxWidth)); //오른쪽 중간 |
|
1197 |
} |
|
1198 |
break; |
|
1199 |
case "270": |
|
1200 |
{ |
|
1201 |
ps.Clear(); |
|
1202 |
|
|
1203 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1204 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
|
1205 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth)); // 위 오른쪽 |
|
1206 |
|
|
1207 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간 |
|
1208 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단 |
|
1209 |
|
|
1210 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); //중간 하단 |
|
1211 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 하단 |
|
1212 |
|
|
1213 |
ps.Add(new Point(Canvas.GetLeft(Base_TextBox) - this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간 |
|
1214 |
} |
|
1215 |
break; |
|
1216 |
//case "180": |
|
1217 |
// { |
|
1218 |
// ps.Clear(); |
|
1219 |
|
|
1220 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox))); //위 왼쪽 |
|
1221 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); // 위 중간 |
|
1222 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox), Canvas.GetTop(Base_TextBox) + this.BoxWidth)); // 위 오른쪽 |
|
1223 |
|
|
1224 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox))); //왼쪽 중간 |
|
1225 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox))); //왼쪽 하단 |
|
1226 |
|
|
1227 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth / 2)); //중간 하단 |
|
1228 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 하단 |
|
1229 |
|
|
1230 |
// ps.Add(new Point(Canvas.GetLeft(Base_TextBox) + this.BoxHeight / 2, Canvas.GetTop(Base_TextBox) + this.BoxWidth)); //오른쪽 중간 |
|
1231 |
// } |
|
1232 |
// break; |
|
1233 |
default: |
|
1234 |
break; |
|
1235 |
} |
|
1236 |
|
|
1237 |
|
|
1238 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.MidPoint); |
|
1239 |
#region 보정치 |
|
1240 |
Point BendingPoint = ConnectionPoint; |
|
1241 |
|
|
1242 | 1194 |
//20180910 LJY 각도에 따라. |
1243 | 1195 |
switch (Math.Abs(this.PageAngle).ToString()) |
1244 | 1196 |
{ |
1245 | 1197 |
case "90": |
1246 | 1198 |
if (isFixed) |
1247 | 1199 |
{ |
1248 |
if (ps[0] == ConnectionPoint) //상단
|
|
1200 |
if (ConnectionPointList[0] == connection) //상단
|
|
1249 | 1201 |
{ |
1250 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1202 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1251 | 1203 |
} |
1252 |
else if (ps[1] == ConnectionPoint) //하단
|
|
1204 |
else if (ConnectionPointList[1] == connection) //하단
|
|
1253 | 1205 |
{ |
1254 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1206 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1255 | 1207 |
} |
1256 |
else if (ps[2] == ConnectionPoint) //좌단
|
|
1208 |
else if (ConnectionPointList[2] == connection) //좌단
|
|
1257 | 1209 |
{ |
1258 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1210 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1259 | 1211 |
} |
1260 |
else if (ps[3] == ConnectionPoint) //우단
|
|
1212 |
else if (ConnectionPointList[3] == connection) //우단
|
|
1261 | 1213 |
{ |
1262 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength , ConnectionPoint.Y);
|
|
1214 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1263 | 1215 |
} |
1264 | 1216 |
} |
1265 | 1217 |
break; |
1266 | 1218 |
case "270": |
1267 | 1219 |
if (isFixed) |
1268 | 1220 |
{ |
1269 |
if (ps[0] == ConnectionPoint) //상단
|
|
1221 |
if (ConnectionPointList[0] == connection) //상단
|
|
1270 | 1222 |
{ |
1271 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1223 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1272 | 1224 |
} |
1273 |
else if (ps[1] == ConnectionPoint) //하단
|
|
1225 |
else if (ConnectionPointList[1] == connection) //하단
|
|
1274 | 1226 |
{ |
1275 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1227 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1276 | 1228 |
} |
1277 |
else if (ps[2] == ConnectionPoint) //좌단
|
|
1229 |
else if (ConnectionPointList[2] == connection) //좌단
|
|
1278 | 1230 |
{ |
1279 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1231 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1280 | 1232 |
} |
1281 |
else if (ps[3] == ConnectionPoint) //우단
|
|
1233 |
else if (ConnectionPointList[3] == connection) //우단
|
|
1282 | 1234 |
{ |
1283 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y );
|
|
1235 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1284 | 1236 |
} |
1285 | 1237 |
} |
1286 | 1238 |
break; |
1287 | 1239 |
default: |
1288 | 1240 |
if (isFixed) |
1289 | 1241 |
{ |
1290 |
if (ps[0] == ConnectionPoint) //상단
|
|
1242 |
if (ConnectionPointList[0] == connection) //상단
|
|
1291 | 1243 |
{ |
1292 |
BendingPoint = new Point(ConnectionPoint.X, ConnectionPoint.Y - _BendingLineLength);
|
|
1244 |
BendingPoint = new Point(connection.X, connection.Y - _BendingLineLength);
|
|
1293 | 1245 |
} |
1294 |
else if (ps[1] == ConnectionPoint) //하단
|
|
1246 |
else if (ConnectionPointList[1] == connection) //하단
|
|
1295 | 1247 |
{ |
1296 |
BendingPoint = new Point(ConnectionPoint.X, ConnectionPoint.Y + _BendingLineLength);
|
|
1248 |
BendingPoint = new Point(connection.X, connection.Y + _BendingLineLength);
|
|
1297 | 1249 |
} |
1298 |
else if (ps[2] == ConnectionPoint) //좌단
|
|
1250 |
else if (ConnectionPointList[2] == connection) //좌단
|
|
1299 | 1251 |
{ |
1300 |
BendingPoint = new Point(ConnectionPoint.X - _BendingLineLength, ConnectionPoint.Y);
|
|
1252 |
BendingPoint = new Point(connection.X - _BendingLineLength, connection.Y);
|
|
1301 | 1253 |
} |
1302 |
else if (ps[3] == ConnectionPoint) //우단
|
|
1254 |
else if (ConnectionPointList[3] == connection) //우단
|
|
1303 | 1255 |
{ |
1304 |
BendingPoint = new Point(ConnectionPoint.X + _BendingLineLength, ConnectionPoint.Y);
|
|
1256 |
BendingPoint = new Point(connection.X + _BendingLineLength, connection.Y);
|
|
1305 | 1257 |
} |
1306 | 1258 |
} |
1307 | 1259 |
break; |
1308 | 1260 |
} |
1261 |
} |
|
1262 |
|
|
1263 |
|
|
1264 |
return BendingPoint; |
|
1265 |
} |
|
1266 |
|
|
1267 |
private void SetArrowTextPath(bool IsInit = false) |
|
1268 |
{ |
|
1269 |
instanceGroup.Children.Clear(); |
|
1270 |
|
|
1271 |
if (Math.Abs(PageAngle).ToString() == "90") |
|
1272 |
{ |
|
1273 |
VisualPageAngle = 270; |
|
1274 |
} |
|
1275 |
else if (Math.Abs(PageAngle).ToString() == "270") |
|
1276 |
{ |
|
1277 |
VisualPageAngle = 90; |
|
1278 |
} |
|
1279 |
else |
|
1280 |
{ |
|
1281 |
VisualPageAngle = PageAngle; |
|
1282 |
} |
|
1283 |
|
|
1284 |
connectorSMGeometry.StartPoint = this.StartPoint; |
|
1285 |
connectorSMGeometry.EndPoint = this.MidPoint; |
|
1286 |
connectorMEGeometry.StartPoint = this.MidPoint; //핵심 |
|
1287 |
|
|
1288 |
/// 텍스트박스의 좌표 설정 |
|
1289 |
Canvas.SetLeft(Base_TextBox, this.EndPoint.X); |
|
1290 |
Canvas.SetTop(Base_TextBox, this.EndPoint.Y); |
|
1309 | 1291 |
|
1310 |
connectorSMGeometry.EndPoint = BendingPoint; |
|
1311 |
connectorMEGeometry.StartPoint = BendingPoint; |
|
1312 |
connectorMEGeometry.EndPoint = ConnectionPoint; |
|
1313 |
instanceGroup.Children.Add(DrawSet.DrawArrow(BendingPoint, this.StartPoint, this.LineSize)); |
|
1314 |
instanceGroup.FillRule = FillRule.Nonzero; |
|
1315 |
this.Base_ArrowPath.Fill = this.StrokeColor; |
|
1316 |
this.Base_ArrowSubPath.Fill = this.StrokeColor; |
|
1292 |
List<Point> ps = GetConnectionPointList(); |
|
1293 |
if (isTrans) |
|
1294 |
{ |
|
1295 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.MidPoint); |
|
1296 |
Point? BendingPoint = GetBendingPoint(ps, ConnectionPoint); |
|
1297 |
if (BendingPoint.HasValue) |
|
1298 |
{ |
|
1299 |
connectorSMGeometry.EndPoint = BendingPoint.Value; |
|
1300 |
connectorMEGeometry.StartPoint = BendingPoint.Value; |
|
1301 |
connectorMEGeometry.EndPoint = ConnectionPoint; |
|
1302 |
|
|
1303 |
//20180910 LJY 각도에 따라. |
|
1304 |
this.MidPoint = BendingPoint.Value; |
|
1305 |
instanceGroup.Children.Add(DrawSet.DrawArrow(BendingPoint.Value, this.StartPoint, this.LineSize)); |
|
1306 |
instanceGroup.FillRule = FillRule.Nonzero; |
|
1307 |
this.Base_ArrowPath.Fill = this.StrokeColor; |
|
1308 |
this.Base_ArrowSubPath.Fill = this.StrokeColor; |
|
1309 |
} |
|
1310 |
} |
|
1311 |
else |
|
1312 |
{ |
|
1313 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.MidPoint); |
|
1314 |
#region 보정치 |
|
1315 |
Point? BendingPoint = GetBendingPoint(ps, ConnectionPoint); |
|
1316 |
if (BendingPoint.HasValue) |
|
1317 |
{ |
|
1318 |
connectorSMGeometry.EndPoint = BendingPoint.Value; |
|
1319 |
connectorMEGeometry.StartPoint = BendingPoint.Value; |
|
1320 |
connectorMEGeometry.EndPoint = ConnectionPoint; |
|
1321 |
instanceGroup.Children.Add(DrawSet.DrawArrow(BendingPoint.Value, this.StartPoint, this.LineSize)); |
|
1322 |
instanceGroup.FillRule = FillRule.Nonzero; |
|
1323 |
this.Base_ArrowPath.Fill = this.StrokeColor; |
|
1324 |
this.Base_ArrowSubPath.Fill = this.StrokeColor; |
|
1325 |
} |
|
1317 | 1326 |
#endregion |
1318 | 1327 |
} |
1319 | 1328 |
|
... | ... | |
1744 | 1753 |
#region 끝점을 이동할때 |
1745 | 1754 |
if (i == 0) |
1746 | 1755 |
{ |
1747 |
if ((pts[0].X > pts[1].X && dx > 0) || (pts[0].X < pts[1].X && dx < 0)) |
|
1748 |
{ |
|
1749 |
pts[1] = new Point(pts[1].X + dx, pts[1].Y); |
|
1750 |
} |
|
1751 |
if ((pts[0].Y > pts[1].Y && dy > 0) || (pts[0].Y < pts[1].Y && dy < 0)) |
|
1752 |
{ |
|
1753 |
pts[1] = new Point(pts[1].X, pts[1].Y + dy); |
|
1754 |
} |
|
1755 |
|
|
1756 |
path.PointSet[1] = pts[1]; |
|
1756 |
var connections = GetConnectionPointList(); |
|
1757 |
var near = MathSet.getNearPoint(connections, selected); |
|
1758 |
var bending = GetBendingPoint(connections, near); |
|
1759 |
if(bending.HasValue) path.PointSet[1] = bending.Value; |
|
1757 | 1760 |
} |
1758 | 1761 |
#endregion |
1759 | 1762 |
#region 중간점을 이동할때 |
내보내기 Unified diff