개정판 8ebd5302
Fix: ArrowTextControl에서 중간점을 이동할때 발생하는 오류 수정
Change-Id: I62efbdb9c622ec878d8a27a543082738a9cd503d
MarkupToPDF/Controls/Text/ArrowTextControl.cs | ||
---|---|---|
21 | 21 |
{ |
22 | 22 |
private const string PART_ArrowPath = "PART_ArrowPath"; |
23 | 23 |
private const string PART_TextBox = "PART_ArrowTextBox"; |
24 |
//private const string PART_TextBlock = "PART_ArrowTextBlock"; |
|
25 | 24 |
private const string PART_ArrowSubPath = "PART_ArrowSubPath"; |
26 | 25 |
private const string PART_Border = "PART_Border"; |
27 | 26 |
private const string PART_BaseTextbox_Caret = "Caret"; |
... | ... | |
214 | 213 |
} |
215 | 214 |
} |
216 | 215 |
|
217 |
public void MoveCustomCaret(Point point) |
|
218 |
{ |
|
219 |
|
|
220 |
var caretLocation = this.Base_TextBox.GetRectFromCharacterIndex(this.Base_TextBox.CaretIndex).Location; |
|
221 |
|
|
222 |
if (!double.IsInfinity(caretLocation.X)) |
|
223 |
{ |
|
224 |
if (Math.Abs(this.PageAngle) == 90) |
|
225 |
{ |
|
226 |
Canvas.SetLeft(this.BaseTextbox_Caret, point.X + caretLocation.Y); |
|
227 |
} |
|
228 |
else if (Math.Abs(this.PageAngle) == 180) |
|
229 |
{ |
|
230 |
|
|
231 |
Canvas.SetLeft(this.BaseTextbox_Caret, (point.X + this.Base_TextBox.ActualWidth) - caretLocation.X); |
|
232 |
} |
|
233 |
else if (Math.Abs(this.PageAngle) == 270) |
|
234 |
{ |
|
235 |
Canvas.SetLeft(this.BaseTextbox_Caret, (point.X) - caretLocation.Y); |
|
236 |
} |
|
237 |
else |
|
238 |
{ |
|
239 |
Canvas.SetLeft(this.BaseTextbox_Caret, point.X + caretLocation.X); |
|
240 |
} |
|
241 |
} |
|
242 |
|
|
243 |
if (!double.IsInfinity(caretLocation.Y)) |
|
244 |
{ |
|
245 |
if (Math.Abs(this.PageAngle) == 90) |
|
246 |
{ |
|
247 |
Canvas.SetTop(this.BaseTextbox_Caret, point.Y - caretLocation.X); |
|
248 |
} |
|
249 |
else if (Math.Abs(this.PageAngle) == 180) |
|
250 |
{ |
|
251 |
Canvas.SetTop(this.BaseTextbox_Caret, (point.Y + this.Base_TextBox.ActualHeight) - caretLocation.Y); |
|
252 |
} |
|
253 |
else if (Math.Abs(this.CommentAngle) == 270) |
|
254 |
{ |
|
255 |
Canvas.SetTop(this.BaseTextbox_Caret, (point.Y) + caretLocation.X); |
|
256 |
} |
|
257 |
else |
|
258 |
{ |
|
259 |
Canvas.SetTop(this.BaseTextbox_Caret, point.Y + caretLocation.Y); |
|
260 |
} |
|
261 |
} |
|
262 |
} |
|
263 |
|
|
264 |
|
|
265 | 216 |
void Base_TextBox_LostFocus(object sender, RoutedEventArgs e) |
266 | 217 |
{ |
267 | 218 |
EditEnd(); |
... | ... | |
1132 | 1083 |
break; |
1133 | 1084 |
} |
1134 | 1085 |
|
1135 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.StartPoint);
|
|
1086 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.MidPoint);
|
|
1136 | 1087 |
|
1137 | 1088 |
//20180911 LJY 꺾이는 부분 수정 |
1138 | 1089 |
Point BendingPoint = ConnectionPoint; |
... | ... | |
1284 | 1235 |
} |
1285 | 1236 |
|
1286 | 1237 |
|
1287 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.StartPoint);
|
|
1238 |
var ConnectionPoint = MathSet.getNearPoint(ps, this.MidPoint);
|
|
1288 | 1239 |
#region 보정치 |
1289 | 1240 |
Point BendingPoint = ConnectionPoint; |
1290 | 1241 |
|
... | ... | |
1780 | 1731 |
IPath path = (this as IPath); |
1781 | 1732 |
|
1782 | 1733 |
Point selected = MathSet.getNearPoint(path.PointSet, pt); |
1783 |
|
|
1784 |
//StartPoint에 표시된 Thumb는 dx,dy가 +로 더해줘야한다. |
|
1785 |
if (path.PointSet.IndexOf(selected) != 0) |
|
1786 |
{ |
|
1787 |
double radian = this.CommentAngle * Math.PI / 180; |
|
1788 |
double cos = Math.Cos(radian); |
|
1789 |
double sin = Math.Sin(radian); |
|
1790 |
|
|
1791 |
double _dx = dx * cos - dy * sin; |
|
1792 |
double _dy = dx * sin + dy * cos; |
|
1793 |
|
|
1794 |
selected.X += _dx; |
|
1795 |
selected.Y += _dy; |
|
1796 |
} |
|
1797 |
else |
|
1798 |
{ |
|
1799 |
selected.X += dx; |
|
1800 |
selected.Y += dy; |
|
1801 |
} |
|
1734 |
selected.X += dx; |
|
1735 |
selected.Y += dy; |
|
1802 | 1736 |
|
1803 | 1737 |
int i = 0; |
1804 | 1738 |
for (i = 0; i < (this as IPath).PointSet.Count; i++) |
... | ... | |
1807 | 1741 |
} |
1808 | 1742 |
|
1809 | 1743 |
List<Point> pts = path.PointSet; |
1810 |
if ((pts[0].X > pts[1].X && dx > 0) || (pts[0].X < pts[1].X && dx < 0)) |
|
1744 |
#region 끝점을 이동할때 |
|
1745 |
if (i == 0) |
|
1811 | 1746 |
{ |
1812 |
pts[1] = new Point(pts[1].X + dx, pts[1].Y); |
|
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]; |
|
1813 | 1757 |
} |
1814 |
if ((pts[0].Y > pts[1].Y && dy > 0) || (pts[0].Y < pts[1].Y && dy < 0)) |
|
1758 |
#endregion |
|
1759 |
#region 중간점을 이동할때 |
|
1760 |
else if (i == 1) |
|
1815 | 1761 |
{ |
1816 |
pts[1] = new Point(pts[1].X, pts[1].Y + dy);
|
|
1762 |
path.PointSet[1] = selected;
|
|
1817 | 1763 |
} |
1818 |
|
|
1819 |
path.PointSet[1] = pts[1]; |
|
1764 |
#endregion |
|
1820 | 1765 |
|
1821 | 1766 |
if (path.PointSet.Count > i) { |
1822 | 1767 |
path.PointSet[i] = selected; |
내보내기 Unified diff